[R] Unique Data Frame Name?

Kjetil Halvorsen kjetilbrinchmannhalvorsen at gmail.com
Thu Jun 24 00:59:48 CEST 2010


\Why not put all the data frames in a list?

Kjetil

On Wed, Jun 23, 2010 at 6:56 PM, Douglas M. Hultstrand
<dmhultst at metstat.com> wrote:
> Hello,
>
> I am trying to create a data frame with a unique name, based on indexing of
> for loop.  I was wondering if there is a way to do this, I keep running into
> errors when I try to do this.  Below is a brief example, I am trying to get
> two data frames (name1 and name2).
>
> Any suggestions are appreciated.
>
> Thanks,
> Doug
>
> # Example
> for (i in 1:2) {
>       x=c(1,2,3,4)
>       y=c(10,20,30,40)
>       G <- paste("name", i, sep="")
>       G[i] <- data.frame(x,y)
> }
>
> --
> ---------------------------------
> Douglas M. Hultstrand, MS
> Senior Hydrometeorologist
> Metstat, Inc. Windsor, Colorado
> voice: 720.771.5840
> email: dmhultst at metstat.com
> web: http://www.metstat.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.
>



More information about the R-help mailing list