4
I need to make several regatta .
for example:
2012ocup10 <- aggregate(PNAD2012[c("peso_pes")], by=PNAD2012["klems"],
FUN=sum,na.rm=T)
but I need to perform the same procedure to PNAD2011,PNAD2010,
...
I use loop this way :
for(ano in (1995:2012)[-c(6,16)]){
tabela.p <- apply(get(paste0("PNAD",ano))[c( "idade", "anos_est", "rend_prin",
"rend_tot",
"horas", "horas_s")],
2,FUN=mean,na.rm=T)
}
When I adapt pro Aggregate I can’t make it create multiple tables (2012ocup10,2011ocup10,...)
.Using get(paste0...) it seems to me that it does not access the variables within the data.frame
Thank you very much ,helped VERY ! I had not thought to use assign ,e nor attack the number in the creation of the object
– Ennio Ferreira