Closed kohlkopf closed 5 years ago
I can only reproduce this if you don't load ggvegan but have loaded ggplot2
r$> library('vegan')
Loading required package: permute
Loading required package: lattice
This is vegan 2.5-5
r$> data(dune)
r$> data(dune.env)
r$> ord <- cca(dune ~ ., dune.env)
If you haven't loaded ggplot2 you'll see this error
r$> autoplot(ord)
Error in autoplot(ord) : could not find function "autoplot"
If you have gplot2 loaded but not ggvegan then you get the error you saw
r$> library('ggplot2')
r$> autoplot(ord)
Error: Objects of type cca not supported by autoplot.
and it works as expected if you load ggvegan
r$> library('ggvegan')
r$> autoplot(ord)
r$>
Do make sure you have done:
## install.packages('remotes') # if you don't have this installed
remotes::install_github('gavinsimpson/ggvegan')
library('ggvegan')
before trying to use functions from the package.
That this works when you load the .R
scripts you mention indicates that the package isn't loaded.
Good catch! Sorry for the SPAM.
Unable to use the function autoplot with my vegan produced cca object. I know that cca is intended to be supported, and I see the autoplot.cca.R code.
> cca_model <- vegan::cca(t(X)~.,t(Y))
> autoplot(cca_model)
Error: Objects of type cca not supported by autoplot.
If I copy/paste the code from autoplot.cca.R and utils.R and don't have any issues.