Skip to content
Prev 316624 / 398506 Next

facet plot

Hi:

Try

DF <- structure(list(Gene = structure(1:5, .Label = c("NM_001001130",
"NM_001001144", "NM_001001152", "NM_001001160", "NM_001001176"
), class = "factor"), T0h = c(68L, 0L, 79L, 1L, 0L), T0.25h = c(95L,
1L, 129L, 1L, 0L), T0.5h = c(56L, 4L, 52L, 2L, 0L), T1h = c(43L,
0L, 50L, 0L, 0L), T2h = c(66L, 1L, 24L, 0L, 0L), T3h = c(62L,
1L, 45L, 1L, 0L), T6h = c(68L, 1L, 130L, 0L, 0L), T12h = c(90L,
4L, 154L, 0L, 0L), T24h = c(63L, 1L, 112L, 0L, 0L), T48h = c(89L,
2L, 147L, 1L, 0L)), .Names = c("Gene", "T0h", "T0.25h", "T0.5h",
"T1h", "T2h", "T3h", "T6h", "T12h", "T24h", "T48h"), class =
"data.frame", row.names = c("1", "2", "3", "4", "5"))

library(reshape2)
library(ggplot2)

# stack the time-related variables by Gene
Dfm <- melt(DF, id = "Gene")
# extract the numeric time values
Dfm$time <- as.numeric(gsub("[a-zA-Z]", "", as.character(Dfm$variable)))

ggplot(Dfm, aes(x = time, y = value)) + geom_point() + facet_wrap(~ Gene)


Dennis

On Thu, Jan 31, 2013 at 2:37 AM, Jose Iparraguirre
<Jose.Iparraguirre at ageuk.org.uk> wrote:
Message-ID: <CADv2QyE_bwHuNfsPfQnv4tRc+hqTFw-4JSay6V5FN4164_zUpg@mail.gmail.com>
In-Reply-To: <E0807BF04F0D0C419BF2B39803E98582010B0281E161@AGEPXCH002C.uk.age.local>