HI, I have the array list: X<-vector("list", 2) X[[1]] : data frame 1 X[[2]]: dataframe2 now i want to change index 1 and 2 into: "0-10" , "11-20" ,. finally I want to have X[["0-10"]]:dataframe1 X[["11-20"]]:dataframe2 how do I get them? Thanks a lot. Kind regards, Tammy [[alternative HTML version deleted]]
names(X) <- c("0-10", "11-20") MW On Fri, Jan 25, 2013 at 9:39 AM, Tammy Ma <metal_licaling at live.com> wrote:> > HI, > > > I have the array list: > > X<-vector("list", 2) > > X[[1]] : data frame 1 > X[[2]]: dataframe2 > > > now i want to change index 1 and 2 into: "0-10" , "11-20" ,. > > finally I want to have > X[["0-10"]]:dataframe1 > X[["11-20"]]:dataframe2 > > how do I get them? > > Thanks a lot. > > Kind regards, > Tammy > > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.
Hi Tammy, Are you just looking for names()? Not sure, but it can be troublesome to have "-" in a name. HTH, Ivan -- Ivan CALANDRA Universit? de Bourgogne UMR CNRS/uB 6282 Biog?osciences 6 Boulevard Gabriel 21000 Dijon, FRANCE +33(0)3.80.39.63.06 ivan.calandra at u-bourgogne.fr http://biogeosciences.u-bourgogne.fr/calandra Le 25/01/13 10:39, Tammy Ma a ?crit :> HI, > > > I have the array list: > > X<-vector("list", 2) > > X[[1]] : data frame 1 > X[[2]]: dataframe2 > > > now i want to change index 1 and 2 into: "0-10" , "11-20" ,. > > finally I want to have > X[["0-10"]]:dataframe1 > X[["11-20"]]:dataframe2 > > how do I get them? > > Thanks a lot. > > Kind regards, > Tammy > > > [[alternative HTML version deleted]] > > ______________________________________________ > 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. >