Distribitrion of samples in R
<p>I have a large count matrix that I would like to visualise. </p>

<p>It contains gene IDs, sample names and abundance. </p>

<p>I would like to see which samples have which genes. </p>

<p>I did this: </p>

<pre><code>d &lt;- read.table("mydata")
library(reshape)
dm &lt;- melt(d)
rn &lt;- row.names(dm)
cn &lt;- colnames(dm)
p = ggplot(dm, aes(x=cn, y=rn)) + stat_binhex(bins=50) + scale_fill_continuous(low="grey50", high=“blue") + p + geom_abline(slope=1, col="white") + labs(title="Sub count matrix")
</code></pre>

<p>but then I get: </p>

<blockquote>
  <p>Error: unexpected input in "p = ggplot(dm, aes(x=cn, y=rn)) +</p>
</blockquote>

<p>I suspect it to be because I don't assign the correct values to rn and cn. </p>

<p>I would like a graph that shows if the genes are present or not with x = samples and y = genes. </p>

<p>Mydata looks something like this: Each column is called V1, V2, V3 etc 
Each row is called the gene ID. </p>

<p>Example of my data: <a href="https://i.stack.imgur.com/OeP1H.jpg" rel="nofollow noreferrer">Small clip of my data</a></p>