R, how can I make a heatmap out of a simple matrix?
<p>Say I have a simple matrix A generated by</p>

<pre><code> A = matrix(c(1,2,3,4,5,6,7,8,9),nrow=3,ncol=3)
</code></pre>

<p>Now, my goal is to make a heatmap out of A, such that each number is replaced by a colour field. How to do that? 
I tried</p>

<pre><code>heatmap(A)
</code></pre>

<p>but it produced three coloured stripes instead of 9 distinct fields.</p>