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
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
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
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.
>
> **
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]]
__
5 matches
Mail list logo