Re: [R] plot multiple data sets on same axis

2007-12-30 Thread Scott Lamb
Scott Lamb wrote: > Scott Lamb wrote: >> I've tried replacing the for loop body with this: >> >> this_method <- split.df[[i]] >> boxplot(elapsed~inactive, data=this_method, >> add=TRUE, border=i, boxfill=i, outline=FALSE) >> >> but it has two problems: >> >> * it doesn't plot at

Re: [R] plot multiple data sets on same axis

2007-12-30 Thread Scott Lamb
Scott Lamb wrote: > I've tried replacing the for loop body with this: > > this_method <- split.df[[i]] > boxplot(elapsed~inactive, data=this_method, > add=TRUE, border=i, boxfill=i, outline=FALSE) > > but it has two problems: > > * it doesn't plot at the correct x values. It

Re: [R] plot multiple data sets on same axis

2007-12-30 Thread Scott Lamb
Thank you - that was exactly what I needed. I just discovered read.csv understands URLs, so here it is with my actual data and formatting: df <- read.csv("http://www.slamb.org/tmp/one-active.csv";) split.df <- split(df, df$method) plot(0, xlim=range(df$inactive), ylim=range(df$elapsed)

Re: [R] plot multiple data sets on same axis

2007-12-30 Thread jim holtman
Here is one way of doing it by splitting the data and plotting each set in a different color: # generate some test data mydf <- data.frame(x=runif(200), y=rnorm(200), dataset=sample(LETTERS[1:4], 200, TRUE)) # setup the plot are for the maximum of the data plot(0, xlim=range(mydf$x), ylim=range(my

[R] plot multiple data sets on same axis

2007-12-30 Thread Scott Lamb
I'm new to R and struggling to reproduce graphs I've made with gnuplot. Example here: http://www.slamb.org/tmp/one-active.png I have three different data sets plotted on the same axis. (I also have a number of samples for each X value which I displayed with quartiles rather than plotting ever