Thanks both! That solves ! You've made a very happy newbie!
Simon
On 2012-03-12, at 2:52 PM, Sarah Goslee wrote:
> Hi Simon,
>
> On Mon, Mar 12, 2012 at 2:37 PM, Simon Kiss wrote:
>> Hi: I'm sure this is a very easy problem. I've consulted Data Manipulation
>> With R and the R Book and can't fi
Your function doesn't return the new data frame but rather the new
names. Note, e.g.
x <- 1:2
names(x) <- letters[1:2]
.Last.value # Not x!
Try this:
.xx<- lapply(.xx, function(x) {colnames(x)<-c('State', 'Year'); x})
or more explicitly
.xx<- lapply(.xx, function(x) {colnames(x)<-c('State', '
Hi Simon,
On Mon, Mar 12, 2012 at 2:37 PM, Simon Kiss wrote:
> Hi: I'm sure this is a very easy problem. I've consulted Data Manipulation
> With R and the R Book and can't find an answer.
>
> Sample list of data frames looks as follows:
>
> .xx<-list(df<-data.frame(Var1=rep('Alabama', 400), Var2
Hi,
On Mon, Mar 12, 2012 at 2:37 PM, Simon Kiss wrote:
> Hi: I'm sure this is a very easy problem. I've consulted Data Manipulation
> With R and the R Book and can't find an answer.
>
> Sample list of data frames looks as follows:
>
> .xx<-list(df<-data.frame(Var1=rep('Alabama', 400), Var2=rep(c
Hi: I'm sure this is a very easy problem. I've consulted Data Manipulation With
R and the R Book and can't find an answer.
Sample list of data frames looks as follows:
.xx<-list(df<-data.frame(Var1=rep('Alabama', 400), Var2=rep(c(2004, 2005, 2006,
2007), 400)), df2<-data.frame(Var1=rep('Tennes
5 matches
Mail list logo