Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to plot summaries of a table in bar chart
    primarykey
    data
    text
    <p>I have a table of SNPs and the information about the corresponding gene: Gene ID, Gene type and Gene Name:</p> <pre><code> SNP Gene ID Gene type Gene Name 1 rs10876864 ENSG00000123411.10 protein_coding IKZF4 2 rs10876864 ENSG00000123411.10 protein_coding IKZF4 3 rs10876864 ENSG00000123411.10 protein_coding IKZF4 4 rs10876864 ENSG00000123411.10 protein_coding IKZF4 5 CNVR2845.57 ENSG00000196126.6 protein_coding HLA-DRB1 6 CNVR2845.57 ENSG00000196126.6 protein_coding HLA-DRB1 7 CNVR2845.57 ENSG00000196126.6 protein_coding HLA-DRB1 8 CNVR2845.57 ENSG00000196126.6 protein_coding HLA-DRB1 9 rs6030897 ENSG00000201372.1 snRNA U6 10 rs6030897 ENSG00000201372.1 snRNA U6 11 rs6030897 ENSG00000201372.1 snRNA U6 </code></pre> <p>I want to plot a bar chart of the total # of SNPs to see how many of the SNPs are protein_coding or snRNA or etc. </p> <p>This is my code so far:</p> <pre><code>barplot(as.matrix(data1), main="SNP", xlab="Gene type", ylab= "Total SNP", names.arg=c("protein_coding","snRNA","pseudogene","antisense","lincRNA",""), border="blue", density=c(10, 20, 30, 40, 50)) </code></pre> <p>But i'm getting an error saying:</p> <pre><code>Error in barplot.default(as.matrix(data1), main = "SNP", xlab = "Gene type", : incorrect number of names In addition: Warning messages: 1: In apply(height, 2L, cumsum) : NAs introduced by coercion 2: In apply(height, 2L, cumsum) : NAs introduced by coercion 3: In apply(height, 2L, cumsum) : NAs introduced by coercion 4: In apply(height, 2L, cumsum) : NAs introduced by coercion </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload