[R] Creating/Concatenate Strings into another String

1 view
Skip to first unread message

Gundala Viswanath

unread,
May 29, 2008, 4:39:36 AM5/29/08
to r-h...@stat.math.ethz.ch
Is there a way to do it?

For example I tried this:

args<-commandArgs()
fname <- args[6]."-".args[9]

# then I would like to create a file
# using the above created name

postscript(filename=fname)
dev.off()

But that concatenation doesn't seem to do it.


--
Gundala Viswanath

______________________________________________
R-h...@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.

Hans-Joerg Bibiko

unread,
May 29, 2008, 4:47:31 AM5/29/08
to Gundala Viswanath, r-h...@stat.math.ethz.ch
On 29 May 2008, at 10:39, Gundala Viswanath wrote:
> Is there a way to do it?
>
> For example I tried this:
>
> args<-commandArgs()
> fname <- args[6]."-".args[9]
This would work under Perl :)

Look for details: ?paste

Try this:

fname <- paste(args[6], ".", args[9], sep="")

--Hans

Reply all
Reply to author
Forward
0 new messages