Re: [R] xyplot - show values of a series on graph

2009-04-08 Thread baptiste auguie
with ggplot2, d - melt(df2,id=year) qplot(year,value,data=d,colour=variable,geom=c(line,point)) + geom_text(data= subset(d, variable == cars), aes(label=value)) with lattice, my best guess would be to use grid.text in a custom panel function. Hope this helps, baptiste On 8 Apr 2009, at

Re: [R] xyplot - show values of a series on graph

2009-04-08 Thread taz9
Thank you very much for your help. I tried to use lattice but I'm not sure how to restrict it to display only the values of cars. xyplot(cars+trucks~year, data=df2, type=o, panel=function(x,y,...){ panel.xyplot(x,y,...) grid.text(unit(x,native),unit(y,native),label=y, just=top)}

Re: [R] xyplot - show values of a series on graph

2009-04-08 Thread Deepayan Sarkar
On Wed, Apr 8, 2009 at 12:25 PM, taz9 alienz...@gmail.com wrote: Thank you very much for your help. I tried to use lattice but I'm not sure how to restrict it to display only the values of cars. xyplot(cars+trucks~year, data=df2, type=o, panel=function(x,y,...){        panel.xyplot(x,y,...)

Re: [R] xyplot - show values of a series on graph

2009-04-08 Thread baptiste auguie
not very clean, but perhaps, xyplot(cars+trucks~year, data=df2, type=o, panel=function(x,y,subscripts,...){ panel.xyplot(x,y,subscripts=subscripts,...) grid .text(unit(df2$year,native),unit(df2$cars,native),label=df2$cars, just=top)} ) baptiste On 8 Apr 2009, at 20:25, taz9

Re: [R] xyplot - show values of a series on graph

2009-04-08 Thread alienz747
Thank you so much Deepayan! My problem is solved. On Wed, Apr 8, 2009 at 3:47 PM, Deepayan Sarkar deepayan.sar...@gmail.comwrote: On Wed, Apr 8, 2009 at 12:25 PM, taz9 alienz...@gmail.com wrote: Thank you very much for your help. I tried to use lattice but I'm not sure how to restrict it

Re: [R] xyplot - show values of a series on graph

2009-04-08 Thread alienz747
This is great, thanks a lot! On Wed, Apr 8, 2009 at 3:50 PM, baptiste auguie ba...@exeter.ac.uk wrote: not very clean, but perhaps, xyplot(cars+trucks~year, data=df2, type=o, panel=function(x,y,subscripts,...){ panel.xyplot(x,y,subscripts=subscripts,...)