In Step 1, we passed the base heatmap() function a matrix, which returns a plot that looks like this:
In Step 2, we used the Rowv and Colv arguments to remove the dendrogram. Note that, in the resulting plot, the columns are in the same order as in the matrix. By using the dendrograms, we can rearrange the columns and rows. The treeless plot looks like this:
In Step 3, we created a palette object using the rainbow() function, which returns the colors for a plot. The first argument to rainbow() is the number of colors. Here, ...