Skip to content

R to automate scatter plots

1 message · R. Michael Weylandt

#
It's usually encouraged to reply to the list as well for
threading/archive reasons. (And because occasionally your first
respondent will say something wrong and require correction -- I was
called out just this morning...oops)

Yes, you seem to be using it right to add a title to the plot but you
have a few syntactical errors (one of which I think came from my first
reply): I think you would prefer this:

paste(data$fpkma, data$pdkmb, main =
paste(substr(files[i],1,nchar(files[i])-4), ".pdf", collapse = ""),
xlab = "FPKM First", ylab = "FPKM Second")

The placement of pdf() is irrelevant to how you get the names: whether
you put it outside or inside the loop, you can still either name it
directly by adding an argument to pdf() or use the default behavior:
the placement only affects whether you want one pdf with all your
plots or multiple pdfs of one plot each. The only other thing is that
you should call pdf() before plot() to make sure the pdf is ready to
take the plot.

Michael

On Thu, Nov 10, 2011 at 11:20 AM, Cynthia Lee Page
<Cynthia.Page at colorado.edu> wrote: