Skip to content

Commit

Permalink
Merge pull request #44 from adamlilith/solstice_2022_2023
Browse files Browse the repository at this point in the history
Removed dependency on **MuMIn** and replaced with **AICcmodavg**
  • Loading branch information
adamlilith authored Jun 6, 2024
2 parents 0e6d555 + 03e4689 commit 4c172bd
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: enmSdmX
Type: Package
Title: Species Distribution Modeling and Ecological Niche Modeling
Version: 1.1.5
Date: 2024-05-16
Version: 1.1.6
Date: 2024-06-06
Authors@R:
c(
person(
Expand All @@ -29,6 +29,7 @@ Description: Implements species distribution modeling and ecological niche
Depends:
R (>= 4.0.0)
Imports:
AICcmodavg,
boot,
data.table,
doParallel,
Expand All @@ -40,7 +41,6 @@ Imports:
maxnet,
methods,
mgcv,
MuMIn,
omnibus,
parallel,
predicts,
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# enmSdmX 1.1.6 2024-06-06
- Replaced dependency on **MuMIn** with one one **AICcmodavg** for calculation of AICc. Received warning that **MuMIn** was going to be archived on CRAN.

# enmSdmX 1.1.5 2024-05-16
- Added function `trainESM()` for ensembles of small models.
- Added several UTM coordinate reference systems accessible through `getCRS()`.
Expand Down
6 changes: 3 additions & 3 deletions R/interpolateRasts.r
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ interpolateRasts <- function(
models[[length(models) + 1]] <- model
k <- c(k, length(model$coefficients))

aicc <- sapply(models, MuMIn::AICc)
aicc <- sapply(models, AICcmodavg::AICc)
interpModel <- models[[which.min(aicc)]]

} else if (type == 'bs') {
Expand Down Expand Up @@ -251,7 +251,7 @@ interpolateRasts <- function(
models[[length(models) + 1]] <- model
k <- c(k, length(model$coefficients))

aicc <- sapply(models, MuMIn::AICc)
aicc <- sapply(models, AICcmodavg::AICc)
interpModel <- models[[which.min(aicc)]]

} else if (type == 'smooth.spline') {
Expand Down Expand Up @@ -314,7 +314,7 @@ interpolateRasts <- function(
models[[length(models) + 1]] <- model
k <- c(k, length(model$coefficients))

aicc <- sapply(models, MuMIn::AICc)
aicc <- sapply(models, AICcmodavg::AICc)
interpModel <- models[[which.min(aicc)]]

}
Expand Down
6 changes: 3 additions & 3 deletions R/trainGam.r
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ trainGAM <- function(
...
)

AICc <- MuMIn::AICc(model)
AICc <- AICcmodavg::AICc(model)

tuning <- data.frame(
model = form,
Expand Down Expand Up @@ -356,7 +356,7 @@ trainGAM <- function(
...
)

AICc <- MuMIn::AICc(model)
AICc <- AICcmodavg::AICc(model)

tuning <- data.frame(
model = form,
Expand Down Expand Up @@ -443,7 +443,7 @@ trainGAM <- function(
...
)

AICc <- MuMIn::AICc(model)
AICc <- AICcmodavg::AICc(model)

# out
out <- if (modelOut) {
Expand Down
6 changes: 3 additions & 3 deletions R/trainGlm.r
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ trainGLM <- function(
...
)

AICc <- MuMIn::AICc(model)
AICc <- AICcmodavg::AICc(model)

tuning <- data.frame(
model = form,
Expand Down Expand Up @@ -419,7 +419,7 @@ trainGLM <- function(
...
)

AICc <- MuMIn::AICc(model)
AICc <- AICcmodavg::AICc(model)

tuning <- data.frame(
model = form,
Expand Down Expand Up @@ -510,7 +510,7 @@ trainGLM <- function(
...
)

AICc <- MuMIn::AICc(model)
AICc <- AICcmodavg::AICc(model)

# out
if (modelOut) {
Expand Down
2 changes: 1 addition & 1 deletion R/trainNs.r
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ trainNS <- function(
...
)

AICc <- MuMIn::AICc(model)
AICc <- AICcmodavg::AICc(model)

# out
out <- if (modelOut) {
Expand Down

0 comments on commit 4c172bd

Please sign in to comment.