Guest User

Untitled

a guest
Oct 17th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. numsamps<-length(topspptry)
  2. numspp<-length(topspptry[[1]])
  3. numcols<-numspp*2
  4. filename<-c("/Users/kristenjenkins/Desktop/OR Field Summer 2011 /R code/topspp_LL_OR_060512.csv")
  5.  
  6. topsppmat<-matrix(0,numspp,numcols)
  7.  
  8. colnames(topsppmat)<-seq(1,numcols,1)
  9.  
  10.  
  11. i=1
  12. for (samp in 1:numsamps){
  13. topsppmat[,i]<-as.character(colnames(topspptry[[samp]]))
  14. topsppmat[,i+1]<-as.numeric(topspptry[[samp]])
  15. colnames(topsppmat)[i]<-paste(rownames(topspptry[[samp]]),"Spp",sep=" ")
  16. colnames(topsppmat)[i+1]<-paste(rownames(topspptry[[samp]]),"n",sep=" ")
  17. i=i+2
  18. }
  19.  
  20. write.csv(topsppmat,filename)
Add Comment
Please, Sign In to add comment