Answers.Body: <p>For working with a relatively small dataset in tabular format, I would recommend <a href="https://cran.r-project.org/web/packages/dplyr/vignettes/dplyr.html" rel="nofollow noreferrer">dplyr</a>. You can read in a <code>excel</code> file using <a href="https://readxl.tidyverse.org" rel="nofollow noreferrer">readxl</a></p>
  
  <pre><code>library(readxl)
  library(dplyr)
  
  df &lt;- read_excel(FILENAME)
  </code></pre>
  
  <p>To get the number of mutations per gene:</p>
  
  <pre><code>df %&gt;% group_by(`Gene name`) %&gt;%
    summarise(num_mutations=n())
  </code></pre>
  
  <p>If you want to know if there are mutations in a particular gene:</p>
  
  <pre><code>df %&gt;% filter(`Gene name` == QUERY)
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-18T11:20:09.763Z
Answers.LastActivityDate: 2018-05-18T11:20:09.763Z
Answers.UserDisplayName: heathobrien
Body: <p>I have a table with information about SNPs, the table has a total of 55127 rows.</p>
  
  <p>How can I know the number of gene mutations in the table and if a gene is present?</p>
  
  <p>The table is in xls format.</p>
  
  <p><a href="https://i.sstatic.net/MfFs4.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/MfFs4.png" alt="enter image description here"></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-18T10:01:12.200Z
Comments.Text: Hi Sofia, recommend  a package for **what**? Could you [edit] the question and explain what is your goal? Also I assume you mean SNP or what is a SNIP? As a side note all post are already signed with the account of the creator, please do not sign them in the body of the post.
Comments.UserDisplayName: llrs
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-18T10:23:16.813Z
Comments.Text: Thanks for the edits, but the main question stills remain. What is your goal, what do you want to do with this data? Do you have a question in mind, a disease, a problem, a treatment? Could you be more clear on this regard, otherwise is too unclear to try an answer
Comments.UserDisplayName: llrs
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-18T10:26:39.350Z
Comments.Text: thanks for the answer, i want to know the number of gene mutations. and to know if a certain gene is in the table.
Comments.UserDisplayName: Sofia
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-18T10:33:10.563Z
Comments.Text: It would be helpful to know the format of the data and the file size. Can you post an example of what the data look like.
Comments.UserDisplayName: heathobrien
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-18T10:56:43.587Z
Comments.Text: Please [edit] your question and explain exactly what you are trying to do. What output do you need? Do you want a list of SNPs per gene? A list of genes in the file? None of these need to be done in R (nor is R particularly well suited for this sort of simple text parsing), do you _need_ R? Also, what operating system are you using? We need to know that to know what tools you have easily available. Finally, what format is the file in? Is that an excel file? A csv? Tab separated? Space separated?
Comments.UserDisplayName: terdon
Tags: <r><snp><mutations>
Title: how to do analysis of a table content SNP?
ThreadText: # how to do analysis of a table content SNP?
  
  (Asked by: username_0 on 2018-05-18)
  
  I have a table with information about SNPs, the table has a total of 55127 rows.
  
  How can I know the number of gene mutations in the table and if a gene is present?
  
  The table is in xls format.
  
  [![enter image description here](https://i.sstatic.net/MfFs4.png)](https://i.sstatic.net/MfFs4.png)
  
  **Tags:** r, snp, mutations
  
  > **Comments:**
  > **username_1**: Hi username_0, recommend  a package for **what**? Could you [edit] the question and explain what is your goal? Also I assume you mean SNP or what is a SNIP? As a side note all post are already signed with the account of the creator, please do not sign them in the body of the post.  
  > **username_1**: Thanks for the edits, but the main question stills remain. What is your goal, what do you want to do with this data? Do you have a question in mind, a disease, a problem, a treatment? Could you be more clear on this regard, otherwise is too unclear to try an answer  
  > **username_0**: thanks for the answer, i want to know the number of gene mutations. and to know if a certain gene is in the table.  
  > **username_2**: It would be helpful to know the format of the data and the file size. Can you post an example of what the data look like.  
  > **username_3**: Please [edit] your question and explain exactly what you are trying to do. What output do you need? Do you want a list of SNPs per gene? A list of genes in the file? None of these need to be done in R (nor is R particularly well suited for this sort of simple text parsing), do you _need_ R? Also, what operating system are you using? We need to know that to know what tools you have easily available. Finally, what format is the file in? Is that an excel file? A csv? Tab separated? Space separated?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2018-05-18. Score: 1
  
  For working with a relatively small dataset in tabular format, I would recommend [dplyr](https://cran.r-project.org/web/packages/dplyr/vignettes/dplyr.html). You can read in a `excel` file using [readxl](https://readxl.tidyverse.org)
  
  ```
  library(readxl)
  library(dplyr)
  
  df <- read_excel(FILENAME)
  
  ```
  
  To get the number of mutations per gene:
  
  ```
  df %>% group_by(`Gene name`) %>%
    summarise(num_mutations=n())
  
  ```
  
  If you want to know if there are mutations in a particular gene:
  
  ```
  df %>% filter(`Gene name` == QUERY)
  
  ```
  
  
  ---
  
  