Thanks to Jim and to Petr for their suggestion.
Stefano
Da: PIKAL Petr [petr.pi...@precheza.cz]
Inviato: giovedì 5 novembre 2015 15.02
A: Stefano Sofia
Cc: r-help@r-project.org
Oggetto: RE: [R] How to change name of pdf output of function windRose in
Dear r-list users,
I am using windRose within the openair package.
Automatically the wind rose is saved in a pdf file called Rplots.pdf .
I need to apply this function to different data frames, and each time I need to
change automatically the name of the pdf output.
I am not able to do it, I
Hi Stefano,
Just start the PDF device, do the plot, then close the PDF device:
library(openair)
...
data(mydata)
pdf("windRose.pdf")
windRose(mydata)
dev.off()
This is from the first example for the windRose function. It will produce a
file named "windRose.pdf" in the working directory of R.
Hi
if you need to do naming automagically you can use ls for creating object
consisting from names of objects and use it for naming inside a cycle.
obj <- ls()
for (i in 1:n) {
pdf(paste(obj[i], "pdf", sep="."))
...
do the plotting
dev.off()
}
Cheers
Petr
> -Original Message-
> From:
4 matches
Mail list logo