This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to take out a column of a heat-map using R

This might seem like a very basic programming question but I generated a heat map using R but need to remove a column and have 2 columns instead of 3. What is the code to do so? Thanks so much.

r heat-map coding programming

Could provide some sample code with which you generated the heatmap?

1 answer

Say your matrix is called x and you are using heat.map as a function and you want to remove the second column:

heat.map(x[,-2]) # removes 2. col from matrix x

Thanks so much Michael!

Log in to answer this question.