Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vegan 2.7.0 splits scores and summary into separate functions #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ importFrom(tidyr,gather)
importFrom(tidyr,separate)
importFrom(tidyr,spread)
importFrom(utils,head)
importFrom(utils,packageVersion)
importFrom(utils,setTxtProgressBar)
importFrom(utils,tail)
importFrom(utils,txtProgressBar)
Expand All @@ -147,6 +148,7 @@ importFrom(vegan,decostand)
importFrom(vegan,estimateR)
importFrom(vegan,metaMDS)
importFrom(vegan,rda)
importFrom(vegan,scores)
importFrom(vegan,specnumber)
importFrom(vegan,vegdist)
importFrom(vegan,vif.cca)
9 changes: 7 additions & 2 deletions R/tbRDA_analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
#' @export
#'
#' @importFrom stats na.omit
#' @importFrom vegan decostand decorana rda vif.cca anova.cca RsquareAdj
#' @importFrom utils packageVersion
#' @importFrom vegan decostand decorana rda vif.cca anova.cca RsquareAdj scores
#'
#' @examples
#' ### Data preparation ###
Expand Down Expand Up @@ -115,7 +116,11 @@ tbRDA_analysis<-function(otudata,envdata,collinearity,perm.test=TRUE){
Diagnostic<-vif.cca(otu.tab.1)
Diagnostic=Diagnostic[!is.na(Diagnostic)]
i=i-1}}}else if (collinearity==FALSE){} else{stop("Please choose TRUE/FALSE on collinearity");return()}
summaryrda<-summary(otu.tab.1)
if (packageVersion("vegan") < "2.7.0") {
summaryrda<-summary(otu.tab.1)
} else { # summary and scores are separated in modern vegan
summaryrda<-c(summary(otu.tab.1), scores(otu.tab.1))
}
if(perm.test==TRUE){
message("###Global permutation test###","\n")
print(anova.cca(otu.tab.1))
Expand Down