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, instead I will ask so I can save some PhD time. I want to plot a subset of my data. x = area y = concentration these data are sorted by z = year (2008 to 2013) So I want to make a plot where I can see x and y >=2012 and <2012. I have tied plot(data$y[year>='2012'], x[year>='2012']) That did not work. also plot(data$y, data$x, year>'2012') did not give the right data plot Any suggestions on how to do this would be appreciated. thanks ______________________________________________ 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.