Variation partitioning is a method used in ecological data analysis to partition the variation in a response variable into different explanatory variables. In R, the vegan package can be used to perform variation partitioning analysis. Here are the steps to do variation partitioning using vegan:
main.r28 chars3 lines
main.r82 chars3 lines
varpart
function to do the variation partitioning analysis.main.r37 chars3 lines
The varpart
function takes a formula as input, with the response variable (ecomor$taxa
) on the left-hand side and the explanatory variables (env
and sp
) on the right-hand side. The output of varpart
provides the portion of variation explained by each explanatory variable and the shared variation between them.
main.r9 chars2 lines
This will create a Venn diagram that shows the unique and shared variation explained by each explanatory variable.
That's it! You have successfully performed variation partitioning using the vegan package in R.
gistlibby LogSnag