Skip to content

Commit

Permalink
Merge pull request #133 from trias-project/add-pkgname-to-distinct-func
Browse files Browse the repository at this point in the history
Add dplyr:: to `distinct()` in `apply_decision_rules()`
  • Loading branch information
damianooldoni authored Jul 3, 2024
2 parents c6c342c + 8d83230 commit 98ef3f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: trias
Title: Process Data for the Project Tracking Invasive Alien Species
(TrIAS)
Version: 2.3.0
Version: 2.3.1
Authors@R: c(
person("Damiano", "Oldoni", email = "[email protected]",
role = c("aut", "cre"), comment = c(ORCID = "0000-0003-3445-7562")),
Expand Down
4 changes: 2 additions & 2 deletions R/apply_decision_rules.R
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ apply_decision_rules <- function(df,
# Get all taxa in df
taxon_keys <-
df %>%
distinct(!!rlang::sym(taxonKey)) %>%
dplyr::distinct(!!rlang::sym(taxonKey)) %>%
dplyr::pull()

# Find taxa whose timeseries don't contain eval_year, remove them and throw a
Expand Down Expand Up @@ -214,7 +214,7 @@ apply_decision_rules <- function(df,
dplyr::filter(!!rlang::sym(y_var) > 0) %>%
dplyr::add_tally(wt = NULL) %>%
dplyr::mutate(dr_1 = n == 1) %>%
distinct(!!rlang::sym(taxonKey), dr_1)
dplyr::distinct(!!rlang::sym(taxonKey), dr_1)

# Rule 2: last value (at eval_year) above median value?
dr_2 <-
Expand Down

0 comments on commit 98ef3f2

Please sign in to comment.