Hi all, 

 

I managed to do what i want (with the great help of thi mailing list)  manually 
. Now i would like to automate it. I would probably need a for loop for to help 
me with this...but of course  I have no idea how to do that in R.  Bellow is 
the code that i would like to be replicated for a number of times (let say 20). 
I would like to achieve  that w1 would change to w2, w3, w4 ... up to w20 and 
by that create 20 data.frames that I would than bind together with cbind. 

 

(i did it like shown bellow -manually)

 

w1<-table(lit$W1)

w1<-as.data.frame(w1)

write.table(w1,file="w1.csv",sep=";",row.names=T, dec=".")

w1 <- w1[order(w1$Freq, decreasing=TRUE),]

w1<-head(w1, 20)

 

 

w2<-table(lit$W2)

w2<-as.data.frame(w2)

write.table(w2,file="w2.csv",sep=";",row.names=T, dec=".")

w2 <- w2[order(w2$Freq, decreasing=TRUE),]

w2<-head(w2, 20)

 

.

.

.

Thanks for the help,m

 

 

 


        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to