Suppose I have "Orange1" data like this. TIME1
RESPONSE RESPSTAT RESPUT REFID ARM SUBARM 0 299.5 Mean 8-item scale 68 0 0 0 287 Median 8-item scale 68 0 0 0 303.9 Mean 8-item scale 68 1 0 0 286 Median 8-item scale 68 1 0 0 295 Mean 8-item scale 85 0 0 12 254 Mean 8-item scale 85 0 0 0 287 Mean 8-item scale 85 1 0 12 216 Mean 8-item scale 85 1 0 0 306 Mean 8-item scale 85 2 0 12 218 Mean 8-item scale 85 2 0 0 273 Mean 8-item scale 18 0 0 1 258.003 Mean 8-item scale 18 0 0 2 261.392 Mean 8-item scale 18 0 0 4 250.812 Mean 8-item scale 18 0 0 0 258 Mean 8-item scale 18 1 0 1 226.153 Mean 8-item scale 18 1 0 2 213.41 Mean 8-item scale 18 1 0 4 206.781 Mean 8-item scale 18 1 0 While I am generating graphs for the above data I am getting four graphs in four pages in a pdf with the following programme. Page1: Only dots (No lines) Page2: Lines observed Page3: Lines observed Page4: Only dots (No lines) I want to get rid of page 1 and 4 i.e Only dots pages while generating the graphs. So that the pdf should contain only two pages(Page 2 & 3) Can anyone help? unique(Orange1$RESPSTAT) -> change pdf("CDAI Response.pdf") for (j in 1:length(change)){ ((Orange1$RESPUT == "8-item scale")&(Orange1$RESPSTAT == change[j])) -> b FD <- Orange1[b, ] unique(FD$REFID) -> refid for (i in refid) { Orange2 <- FD[i == FD$REFID, ] Orange2$ARM<- factor(Orange2$ARM) unique(Orange2$RESPSTAT) -> x y <- paste("REFID=", i,"; ", "RESPSTAT=", x, sep="") print(qplot(TIME1, RESPONSE, data=Orange2, geom= c("line", "point"), colour=ARM, main=y)) } } dev.off() Notice: The information contained in this electronic mail message is intended only for the use of the designated recipient. This message is privileged and confidential. and the property of GVK BIO or its affiliates and subsidiaries. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by telephone +91-40-66929999<tel:+91-40-66929999> and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies). [[alternative HTML version deleted]] ______________________________________________ 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.