Re: [R] Paste problem when looping variable assignments

From: Jonathan Daily <biomathjdaily_at_gmail.com>
Date: Fri, 22 Apr 2011 15:22:00 -0400

The function you are looking for is ?assign.

assign(paste(pds_gagehandles[[i]], "_pdswy", sep = ""), ...)

For the reverse, in case you are interested, check out ?get.

HTH,
Jon

On Fri, Apr 22, 2011 at 1:49 PM, armstrwa <William.Armstrong_at_noaa.gov> wrote:
> One thing I should have mentioned before is that "pds_gagehandles" is a
> character vector that contains the site names that I am interested in.  An
> example of a site name is "saho".
>
> So with with the paste function, I am trying to get R to assign a variable
> with the site name followed by "_potwy".  For example, I am trying to create
> a vector of events/year named "saho_potwy".
>
> Thanks again.
>
> Billy
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Paste-problem-when-looping-variable-assignments-tp3468414p3468429.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>

-- 
===============================================
Jon Daily
Technician
===============================================
#!/usr/bin/env outside
# It's great, trust me.

______________________________________________
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 Fri 22 Apr 2011 - 19:33:51 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 Fri 22 Apr 2011 - 19:50:32 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