Dear R users, I need to rename the columns of a series of data frames. The names of the data frames and those of the columns need to be pulled from some vectors. I tried a couple of things but only got errors. What am I missing?
#---create data frame dframes <- c("a","b","c") assign(dframes[2],data.frame(11:20,21:30)) #---rename the columns cols <- c("one","two") > names(get(dframes[2])) <- cols Error: couldn't find function "get<-" > assign(dframes[2],data.frame(cols[1]=11:20,cols[2]=21:30)) Error: syntax error > labels(get(dframes[2]))[[2]] <- cols Error: couldn't find function "labels<-" I'm using R 2.0.0 on Windows XP. Thank you, b. ______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html