I am having issues with conducting a partial Canonical Correspondence Analysis (pCCA) in R. The data associated with code is quite extensive so I am unable to include it here.
The following code produces the error below it. In the pCCA model, I am attempting to account for both environmental and spatial variables in explaining species matrix. Spatial variables are Latitude and Longitude values. Env2 variables are a host of continuous and a few binary (0,1) environmental variables.
mod2 <-cca(species ~ env2 + spatial)
Error in model.frame.default(~env2 + spatial, na.action = na.pass, xlev = NULL) : invalid type (list) for variable 'env2'
I have used unlist () for both env2 and spatial, but it does not work. Thoughts?