On 04/26/2012 08:02 PM, Manish Gupta wrote:
Hi,

I have my data in below format.

position         var1            var2
2                       .1                 10
3                       .29               89
12                    .56               100
425                 .34                1234
6546              .12                 21
....                   .....                 .....
....                   .....                ......
....                   .....                ......

I need to plot a grpah for above with position as x - axis and two variables
with as line on the same plot. I have 5 million records.  How can i
implement it efficiently.

Hi Manish,
You can plot this with twoord.plot (plotrix):

position<-c(2,3,12,425,6546)
var1<-c(.1,.29,.56,.34,.12)
var2<-c(10,89,100,1234,21)
library(plotrix)
twoord.plot(lx=position,ly=var1,rx=position,ry=var2)

but with 5 million records you will just have a jagged block of color. I think ghostwheel's suggestion of reducing the number of points is very sensible.

Jim

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to