Re: [R] variable as part of file name

From: Hans-Jörg Bibiko <bibiko_at_eva.mpg.de>
Date: Wed, 02 Jul 2008 16:22:03 +0200

On 02.07.2008, at 15:31, Laura Poggio wrote:

> Dear all,
> sorry for this very basic question, but I did not find any good
> example yet.
>
> I would like to set up a variable that can be recall later to
> substitute a
> part of a file name.
> As example:
>
> var_filename = as.name("aaa")
>
> jpeg("var_filename.jpg")
> plot()
> dev.off()

try:
var_filename <- 'foo'
jpeg( paste( var_filename, '.jpg', sep='' ) )

See ?paste

--Hans



R-help_at_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. Received on Wed 02 Jul 2008 - 15:00:26 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 02 Jul 2008 - 16:30:57 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive