Re: [R] How to join path with arguments

From: Andre Nathan <andre_at_digirati.com.br>
Date: Tue, 19 Feb 2008 09:47:37 -0300 (BRT)

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(name1, "png", sep = ".")

[1] "sample-plot.png"

HTH,
Andre



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 Tue 19 Feb 2008 - 12:50:22 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 Tue 19 Feb 2008 - 13:30:16 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