0

Is there an alternative to ggvegan for creating a pca plot in R version 4.0.0. I have used the rda function with the following script:

dput(mite.env)
pca<-rda(mite.env[,1:2])
summary(pca)
autoplot(pca, arrows = TRUE)

However, it appears that ggvegan is not available for the latest version of R. Is there an alternative?

Gwang-Jin Kim
  • 9,303
  • 17
  • 30
Angela
  • 13
  • 1
  • 7

1 Answers1

1

Do

if (!require(devtools)) {
  install.packages("devtools")
}
devtools::install_github("gavinsimpson/ggvegan")

devtools::install_github("githubadress") should be always in your toolbelt as an R developer to fetch the newest up-to-date versions of an R package freshly from github.

I tried this with R 4.0.2 and it worked.

Gwang-Jin Kim
  • 9,303
  • 17
  • 30
  • Thanks for your feedback. Initially, I tried something similar (which are the lines of code following the # tags). I then tried your suggestion: ```{r} library(vegan) library(ggplot2) library(devtools) #devtools::install_github("gavinsimpson/ggvegan") #library(ggvegan) if (!require(devtools)) { install.packages("devtools") } devtools::install_github("gavinsimpson/ggvegan") library(ggvegan) ``` – Angela Sep 08 '20 at 06:24
  • This just updated my current packages and returned the same error : Error in library(ggvegan) : there is no package called ‘ggvegan’ – Angela Sep 08 '20 at 06:24
  • I was able to get a plot up with this : biplot(pca,scaling = "symmetric") I'm not sure if it is as good though – Angela Sep 08 '20 at 06:28
  • No what is that? – Angela Sep 08 '20 at 06:35
  • Is R 4.0.2 the latest version of R – Angela Sep 08 '20 at 06:35
  • `conda` is a universal package manager. It can handle all languages. However, community must prepare the packages in a special way. Short but very good tutorial is here: https://www.youtube.com/watch?v=YJC6ldI3hWk&t=6s – Gwang-Jin Kim Sep 08 '20 at 06:37
  • with conda, you can generate virtual environments. I generate for each R version I use a new environment. And then one can switch easily between different R versions. – Gwang-Jin Kim Sep 08 '20 at 06:38
  • are you in linux or windows or mac? – Gwang-Jin Kim Sep 08 '20 at 06:38
  • Awesome! I am on windows. By the way, I just updated to version 4.0.2 and was able to install ggvegan, which made a beautiful plot. Thanks for your help today. – Angela Sep 08 '20 at 07:53
  • welcome - please don't forget to accept and/or upvote - always in stackoverflow - people answering use their free time to answer ;) – Gwang-Jin Kim Sep 08 '20 at 07:58