I am working with a community ecology data set based around algal pigments and trying to understand what variables are driving changes in community composition/pigment concentrations. To answer this question, I plan on doing a variation partitioning approach to see which of my environmental drivers are most significantly influencing the changes in microalgae pigments. I am doing a test run with a limited data frame to see if this approach reveals anything notable/ it works.
I have my community structure data frame , benthiccc, and the two data frames that I'm treating as my x-variable matricies: chemaxis = chemical sediment and h20 parameters that may be driving variation phyaxis = physical parameters that my be driving variation
my code is:
benthic_all_varpar <- varpart(benthiccc, chemaxis, physaxis)
but returns the error:
Error in varpart2(Y, Sets[[1]], Sets[[2]], chisquare, permutations) :
Y and X1 do not have the same number of rows
When I look at the dataframes however, they have the same number of rows (333). Does this have to do with NA values? I have many rows (~100) that do not have fully complete data sets, and therefore have NA values. Is there anyway to work around this so that I don't loose over 100 data points because of their incompleteness? Many of the data points are missing only one parameter, and it would greatly weaken my strength to get rid of that many points.
Any help or suggestions would be greatly appreciated!!