Re: [R] Subset for plot in R

2014-02-19 Thread Greg Snow
So are the names of the columns in the dataset x, y, and z? or are they area, concentration, and year? you seem to be mixing these together? If you provide a minimal reproducible example (provide some data with dput, or the commands to generate random data, or use a built in dataset) then it make

Re: [R] Subset for plot in R

2014-02-17 Thread arun
Hi, Try: set.seed(49)  dat1 <- data.frame(year= rep(2010:2013,c(10,8,9,13)),x=sample(1e4,40,replace=TRUE),y=sample(40,40,replace=TRUE)) plot(x~y,data=dat1,subset=year > 2012) #or with(subset(dat1,year > 2012),plot(y,x)) A.K. Hi R people This might take me the whole day to figure out, instea