Hi Jinggaofu,
Try this:
for(u in 1:9) {
pdffile<-paste(g[u],".pdf",sep="")
pdf(pdffile)
...
mtext(g[u],side=4)
If you index the vector g, it will return one or more character strings.
Jim
On Thu, Mar 3, 2016 at 9:52 AM, Jinggaofu Shi wrote:
> Hi, there
> I am new to R, here is an urgent que
1. Please spend some time with an R tutorial or two to become familiar
with R basics.
2. Please do not post in HTML. This is a plain text email list.
3. See e.g. ?sprintf or ?paste for your problem.
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming al
Hi, there
I am new to R, here is an urgent question.
I want to save several graphs by a for loop. But I don't know how to refer
the variable in the quotes.
Here is my code.
g<-c("g1","g2","g3","g4","g5","g6","g7","g8","g9")
for (u in 1:9) {pdf("g[u]".pdf")
+ plot(1,1, xlim=range(x), ylim=c(-5,5),
3 matches
Mail list logo