Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- numsamps<-length(topspptry)
- numspp<-length(topspptry[[1]])
- numcols<-numspp*2
- filename<-c("/Users/kristenjenkins/Desktop/OR Field Summer 2011 /R code/topspp_LL_OR_060512.csv")
- topsppmat<-matrix(0,numspp,numcols)
- colnames(topsppmat)<-seq(1,numcols,1)
- i=1
- for (samp in 1:numsamps){
- topsppmat[,i]<-as.character(colnames(topspptry[[samp]]))
- topsppmat[,i+1]<-as.numeric(topspptry[[samp]])
- colnames(topsppmat)[i]<-paste(rownames(topspptry[[samp]]),"Spp",sep=" ")
- colnames(topsppmat)[i+1]<-paste(rownames(topspptry[[samp]]),"n",sep=" ")
- i=i+2
- }
- write.csv(topsppmat,filename)
Add Comment
Please, Sign In to add comment