Вопрос

I'm new to R and i want to generate a one row heatmap from my data using heatmap.2 as reported in "Widespread dynamic DNA methylation in response to biotic stress", Figure 3C (Dowen et al., 2012). The following is a link to the article: pnas.org/content/109/32/E2183/1

enter image description here

My effective data is just a column with values between -1 and 1:

   deltaMeth
     -1
     -1
    -0.9
    -0.8
    -0.2
     0.3
     0.6
     0.7
     0.8
      1

My goal is to create a heatmap similar to the reported by (Dowen et al., 2012) using my dataset.

Thanks.

Это было полезно?

Решение

You can plot a heatmap of a one-column dataset with image:

library(graphics)
mat <- matrix(c(-1, -1, -.9, -.8, -.2, .3, .6, .7, .8, 1))
image(mat)

enter image description here

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top