Skip to content
Prev 200625 / 398503 Next

Lattice plot

Hi,

ggplot2 can also split the graphs in different panels,

d=
read.table(textConnection(
"chr start1 end1 meth positive
1   1     10   20  1.5        y
2   2     12   18 -0.7        n
3   3     22   34  2.0        y
4   1     35   70  3.0        y
5   1    120  140 -1.3        n
6   1    180  190  0.2        y
7   2    220  300  0.4        y"), head=T)

library(ggplot2)
ggplot(data=d) + facet_grid(.~chr) +
 geom_segment(aes(x=start1, xend=end1, y=meth, yend=meth))


HTH,

baptiste


2009/11/17 Tim Smith <tim_smith_666 at yahoo.com>: