[R] paste together a string object later to be utilized in a function
Greg Snow
Greg.Snow at imail.org
Mon Jun 7 22:31:49 CEST 2010
Does the collapse argument to the paste function do what you want? Possibly nested inside another paste.
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of moleps
> Sent: Sunday, June 06, 2010 1:51 PM
> To: r-help at r-project.org
> Subject: [R] paste together a string object later to be utilized in a
> function
>
> Dear r-listers,
>
> I need to pass a string to a function. However the length of the string
> is dependent on the length of a vector.
>
>
> b<-length(h)
> v<-paste("rep(names(ts$a[",1:b,"]),ts$a[",1:b,"])",sep="")
>
>
> Is it possible somehow to pass this as an argument to a function later
> on ?
>
>
>
> Regards,
>
> //M
>
> ______________________________________________
> 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.
More information about the R-help
mailing list