title: apply function in a character dataframe
body: <p>I have a data frame that looks like this:</p>
  
  <pre><code> GID7173723 GID4878677 GID88208 GID346403 GID268825 GID7399578
  1           A          A        A         A         G          A
  2           T          T        T         T         C          T
  3           G          G        G         G         G          G
  4           A          A        A         A         A          A
  5           G          G        G         G         G          G
  6           G          G        G         G         G          G
  7           A          A        A         A         A          A
  8           G          G        G         G         G          G
  9           A          A        A         A         A          A
  10          A          A        A         A         A          A
  </code></pre>
  
  <p>However, when I use the apply function to get the sum of all 'A' by row divided by the number of columns in the dataframe, I get the total sum of A's instead of getting row sums.</p>
  
  <p>Here is the function I wrote:</p>
  
  <pre><code>myfun &lt;- function(x){
   out &lt;-  sum(x=='A')/ncol(x)
   return(out)
  }
  apply(df,MARGIN = 1,FUN=myfun)
  </code></pre>
  
  <p>I cannot figure out why the apply function gives me the total sum of A and not by row.</p>