Skip to content

Commit b67331b

Browse files
committed
sppEquivalencies read from URL; landR removed from dependencies
1 parent 70cf248 commit b67331b

3 files changed

Lines changed: 8 additions & 12 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Description: Implementation of several components of the Carbon Budget Model of
55
Canadian Forest Service (v3).
66
URL:
77
https://github.com/PredictiveEcology/CBMutils
8-
Version: 2.5.3.9002
8+
Version: 2.5.4.9000
99
Authors@R: c(
1010
person("Céline", "Boisvenue", email = "celine.boisvenue@nrcan-rncan.gc.ca", role = c("aut", "cre")),
1111
person("Alex M", "Chubaty", email = "achubaty@for-cast.ca", role = c("aut"), comment = c(ORCID = "0000-0001-7146-8135")),
@@ -42,13 +42,11 @@ Suggests:
4242
exactextractr,
4343
FNN,
4444
qs2,
45-
LandR,
4645
reproducible,
4746
SpaDES.core,
4847
rmarkdown,
4948
testthat
5049
Remotes:
51-
PredictiveEcology/LandR@development,
5250
PredictiveEcology/reproducible@development,
5351
PredictiveEcology/SpaDES.core@development
5452
VignetteBuilder: knitr, rmarkdown

R/CBM-DB_species.R

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,14 @@ utils::globalVariables(c(
2424
#' @importFrom data.table as.data.table
2525
sppMatch <- function(species, match = c("LandR", "Latin_full", "EN_generic_short", "EN_generic_full"),
2626
otherNames = NULL, return = NULL, checkNA = !is.null(return),
27-
sppEquivalencies = NULL){
27+
sppEquivalencies = "https://github.com/PredictiveEcology/LandR/raw/refs/heads/development/data-raw/sppEquivalencies_CA.csv"){
2828

2929
# Read species equivalencies table
30-
if (is.null(sppEquivalencies)){
31-
if (length(find.package("LandR", quiet = TRUE)) == 0) stop("LandR package required")
32-
sppEquivalencies <- LandR::sppEquivalencies_CA
30+
if (!is.data.frame(sppEquivalencies)){
31+
sppEquivalencies <- data.table::fread(sppEquivalencies)
32+
}else{
33+
sppEquiv <- data.table::as.data.table(sppEquivalencies)
3334
}
34-
sppEquiv <- tryCatch(
35-
as.data.table(sppEquivalencies),
36-
error = function(e) stop(
37-
"sppEquivalencies could not be converted to data.table: ", e$message, call. = FALSE))
3835

3936
# Return 0 rows
4037
if (length(species) == 0) return(sppEquiv[0,])

man/sppMatch.Rd

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)