[R] re-arranging data to create an image (or heatmap)

pierz s.piersma at gmail.com
Mon Mar 7 18:16:42 CET 2011


It turned out that rearranging the data was indeed the key to get the image I
want. The way I do it now is this:

tt <- read.csv(file="file.csv", header=T, sep=",", dec=".",
stringsAsFactors=F)
names(tt) <- c('time','abs')
dat <- with(tt, table(time, abs))
image(dat,col=rainbow(256))

I'm now modifying the rainbow color palette to match my needs. Also, the
X-axis and Y-axis display values between 0 and 1, so I want to change them
to show the actual time and abs values.

--
View this message in context: http://r.789695.n4.nabble.com/re-arranging-data-to-create-an-image-or-heatmap-tp3327986p3339498.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list