Re: [R] How to join path with arguments

2008-02-19 Thread Prof Brian Ripley
Please just use file.path(inputdir, filename). Apart from being less error-prone, in R 2.7.0 it will be internal and so faster (and in case you wonder how paste could be too slow, it was in some of the package installation/checking computations). On Tue, 19 Feb 2008, Henrique Dallazuanna wrot

Re: [R] How to join path with arguments

2008-02-19 Thread Andre Nathan
Hyunchul Kim wrote: > How to format and join strings ? > For example, like following short python examples. > > * > name1 = 'sample-plot' > filename = '%s.png' % name1 Two options are sprintf() and paste(): > name1 = "sample-plot" > sprintf("%s.png", name1) [1] "sample-plot.png" > paste

Re: [R] How to join path with arguments

2008-02-19 Thread Henrique Dallazuanna
Ops, paste(inputdir, filename, sep="") should be paste(inputdir, filename, sep="/") On 19/02/2008, Henrique Dallazuanna <[EMAIL PROTECTED]> wrote: > Try this: > > name1 <- 'sample-plot' > filename <- sprintf("%s.png", name1) > inputdir <- '/path/to/dir' > paste(inputdir, filename, sep="") > > > On

Re: [R] How to join path with arguments

2008-02-19 Thread Henrique Dallazuanna
Try this: name1 <- 'sample-plot' filename <- sprintf("%s.png", name1) inputdir <- '/path/to/dir' paste(inputdir, filename, sep="") On 19/02/2008, Hyunchul Kim <[EMAIL PROTECTED]> wrote: > Hi, all > > How to format and join strings ? > For example, like following short python examples. > > **

[R] How to join path with arguments

2008-02-19 Thread Hyunchul Kim
Hi, all How to format and join strings ? For example, like following short python examples. * name1 = 'sample-plot' filename = '%s.png' % name1 inputdir = '/path/to/dir' os.path.join(inputdir, filename) ** Best, Hyunchul Kim [[alternative HTML version deleted]] __