I want to use SIMPER with vegan package to see which species are contributing the most given each year.
#4th root transformation
BBcounts_transformed<-siteBB^(1/4)
BBcounts_transformed.matrix<-as.matrix(BBcounts_transformed)
#Bray-Curtis Diss.
BBtrans_bray<-vegdist(BBcounts_transformed.matrix, method="bray")
SIMPER requires the dissimilarity matrix be put into a dataframe, however I'm struggling with this as data.frame function just puts all the distance values into a single column which wont align with the measuring factor. The bray is looking at distances between years with the species matrix(species in columns x 12 separate years in rows). They are either cold or hot years.
BBtrans_bray.df<-as.data.frame(BBtrans_bray)
BBtrans.simper_result<-simper(BBtrans_bray,site_BB2$TempH)
I am still fairly new to Bray and SIMPER so any help would be appreciated at this point.
The "simper" function itself calculates Bray Curtis dissimilarity directly from the community data. You have to put your species matrix as the first argument instead of an object with a dissimilarity matrix. Try this:
For more information please see: