From f21451ff4deae917159b8192de725c73475f3ea9 Mon Sep 17 00:00:00 2001 From: sgvignali Date: Thu, 19 Nov 2020 16:08:51 +0100 Subject: [PATCH] Add new test from dismo to check maxent --- R/SDMmodel2MaxEnt.R | 2 +- R/maxentTh.R | 2 +- R/maxentVarImp.R | 2 +- R/reduceVar.R | 2 +- R/train.R | 2 +- R/varSel.R | 2 +- man/SDMmodel2MaxEnt.Rd | 2 +- man/maxentTh.Rd | 2 +- man/maxentVarImp.Rd | 2 +- man/reduceVar.Rd | 2 +- man/train.Rd | 2 +- man/varSel.Rd | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/R/SDMmodel2MaxEnt.R b/R/SDMmodel2MaxEnt.R index ecd81876..40f13736 100644 --- a/R/SDMmodel2MaxEnt.R +++ b/R/SDMmodel2MaxEnt.R @@ -27,7 +27,7 @@ #' # Train a Maxent model #' # The next line checks if Maxent is correctly configured but you don't need #' # to run it in your script -#' if (checkMaxentInstallation(verbose = FALSE)) { +#' if (dismo::maxent(silent = TRUE)) { #' model <- train(method = "Maxent", data = data, fc = "l") #' #' dismo_model <- SDMmodel2MaxEnt(model) diff --git a/R/maxentTh.R b/R/maxentTh.R index f5c4907c..a370784b 100644 --- a/R/maxentTh.R +++ b/R/maxentTh.R @@ -29,7 +29,7 @@ #' # Train a Maxent model #' # The next line checks if Maxent is correctly configured but you don't need #' # to run it in your script -#' if (checkMaxentInstallation(verbose = FALSE)) { +#' if (dismo::maxent(silent = TRUE)) { #' model <- train(method = "Maxent", data = data, fc = "l") #' maxentTh(model) #' } diff --git a/R/maxentVarImp.R b/R/maxentVarImp.R index 74f97d7c..63daf5a3 100644 --- a/R/maxentVarImp.R +++ b/R/maxentVarImp.R @@ -34,7 +34,7 @@ #' # Train a Maxent model #' # The next line checks if Maxent is correctly configured but you don't need #' # to run it in your script -#' if (checkMaxentInstallation(verbose = FALSE)) { +#' if (dismo::maxent(silent = TRUE)) { #' model <- train(method = "Maxent", data = data, fc = "l") #' maxentVarImp(model) #' } diff --git a/R/reduceVar.R b/R/reduceVar.R index c25745e2..86fa405e 100644 --- a/R/reduceVar.R +++ b/R/reduceVar.R @@ -72,7 +72,7 @@ #' # Train a Maxent model #' # The next line checks if Maxent is correctly configured but you don't need #' # to run it in your script -#' if (checkMaxentInstallation(verbose = FALSE)) { +#' if (dismo::maxent(silent = TRUE)) { #' model <- train(method = "Maxent", data = train, fc = "lq") #' #' # Remove all variables with percent contribution lower than 2% diff --git a/R/train.R b/R/train.R index fbfb2d9c..1617b849 100644 --- a/R/train.R +++ b/R/train.R @@ -113,7 +113,7 @@ #' ## Train a Maxent model #' # The next line checks if Maxent is correctly configured but you don't need #' # to run it in your script -#' if (checkMaxentInstallation(verbose = FALSE)) { +#' if (dismo::maxent(silent = TRUE)) { #' model <- train(method = "Maxent", data = data, fc = "l", reg = 1.5, #' iter = 700) #' diff --git a/R/varSel.R b/R/varSel.R index dcc57618..b8d6d323 100644 --- a/R/varSel.R +++ b/R/varSel.R @@ -81,7 +81,7 @@ #' # Train a model #' # The next line checks if Maxent is correctly configured but you don't need #' # to run it in your script -#' if (checkMaxentInstallation(verbose = FALSE)) { +#' if (dismo::maxent(silent = TRUE)) { #' model <- train(method = "Maxent", data = train, fc = "l") #' vs <- varSel(model, metric = "tss", bg4cor = bg, test = test, cor_th = 0.7, #' use_pc = TRUE) diff --git a/man/SDMmodel2MaxEnt.Rd b/man/SDMmodel2MaxEnt.Rd index f6c625a8..2c6df076 100644 --- a/man/SDMmodel2MaxEnt.Rd +++ b/man/SDMmodel2MaxEnt.Rd @@ -34,7 +34,7 @@ data <- prepareSWD(species = "Virtual species", p = p_coords, a = bg_coords, # Train a Maxent model # The next line checks if Maxent is correctly configured but you don't need # to run it in your script -if (checkMaxentInstallation(verbose = FALSE)) { +if (dismo::maxent(silent = TRUE)) { model <- train(method = "Maxent", data = data, fc = "l") dismo_model <- SDMmodel2MaxEnt(model) diff --git a/man/maxentTh.Rd b/man/maxentTh.Rd index f5c37b1d..903f5c53 100644 --- a/man/maxentTh.Rd +++ b/man/maxentTh.Rd @@ -33,7 +33,7 @@ data <- prepareSWD(species = "Virtual species", p = p_coords, a = bg_coords, # Train a Maxent model # The next line checks if Maxent is correctly configured but you don't need # to run it in your script -if (checkMaxentInstallation(verbose = FALSE)) { +if (dismo::maxent(silent = TRUE)) { model <- train(method = "Maxent", data = data, fc = "l") maxentTh(model) } diff --git a/man/maxentVarImp.Rd b/man/maxentVarImp.Rd index 494e5bd1..eedf9fc5 100644 --- a/man/maxentVarImp.Rd +++ b/man/maxentVarImp.Rd @@ -39,7 +39,7 @@ data <- prepareSWD(species = "Virtual species", p = p_coords, a = bg_coords, # Train a Maxent model # The next line checks if Maxent is correctly configured but you don't need # to run it in your script -if (checkMaxentInstallation(verbose = FALSE)) { +if (dismo::maxent(silent = TRUE)) { model <- train(method = "Maxent", data = data, fc = "l") maxentVarImp(model) } diff --git a/man/reduceVar.Rd b/man/reduceVar.Rd index 5e15c7bd..3750e054 100644 --- a/man/reduceVar.Rd +++ b/man/reduceVar.Rd @@ -94,7 +94,7 @@ output <- reduceVar(model, th = 2, metric = "aicc", permut = 1, # Train a Maxent model # The next line checks if Maxent is correctly configured but you don't need # to run it in your script -if (checkMaxentInstallation(verbose = FALSE)) { +if (dismo::maxent(silent = TRUE)) { model <- train(method = "Maxent", data = train, fc = "lq") # Remove all variables with percent contribution lower than 2\% diff --git a/man/train.Rd b/man/train.Rd index c46fe66b..fa600185 100644 --- a/man/train.Rd +++ b/man/train.Rd @@ -106,7 +106,7 @@ data <- prepareSWD(species = "Virtual species", p = p_coords, a = bg_coords, ## Train a Maxent model # The next line checks if Maxent is correctly configured but you don't need # to run it in your script -if (checkMaxentInstallation(verbose = FALSE)) { +if (dismo::maxent(silent = TRUE)) { model <- train(method = "Maxent", data = data, fc = "l", reg = 1.5, iter = 700) diff --git a/man/varSel.Rd b/man/varSel.Rd index b29fa34a..5b23edfc 100644 --- a/man/varSel.Rd +++ b/man/varSel.Rd @@ -108,7 +108,7 @@ vs # Train a model # The next line checks if Maxent is correctly configured but you don't need # to run it in your script -if (checkMaxentInstallation(verbose = FALSE)) { +if (dismo::maxent(silent = TRUE)) { model <- train(method = "Maxent", data = train, fc = "l") vs <- varSel(model, metric = "tss", bg4cor = bg, test = test, cor_th = 0.7, use_pc = TRUE)