Skip to content

Commit

Permalink
Merge pull request #110 from inbo/dev_assertthatconflict
Browse files Browse the repository at this point in the history
noNA conflict of `assertthat` and `terra`
  • Loading branch information
florisvdh authored Nov 13, 2024
2 parents e055df6 + 1032f21 commit c8bddf7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion R/eval.R
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ eval_chem <- function(data,
date, lab_sample_id, chem_variable, value, unit, below_loq."
)

assert_that(is.flag(uniformity_test), noNA(uniformity_test))
assert_that(is.flag(uniformity_test), assertthat::noNA(uniformity_test))

data <-
data %>%
Expand Down
18 changes: 9 additions & 9 deletions R/get.R
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,11 @@ get_locs <- function(con,
assert_that(is.null(area_codes) | all(is.character(area_codes)))
assert_that(is.null(loc_vec) | all(is.character(loc_vec)),
msg = "loc_vec must be a character vector.")
assert_that(is.flag(join_mask), noNA(join_mask))
assert_that(is.flag(collect), noNA(collect))
assert_that(is.flag(obswells), noNA(obswells))
assert_that(is.flag(filterdepth_guess), noNA(filterdepth_guess))
assert_that(is.flag(filterdepth_na), noNA(filterdepth_na))
assert_that(is.flag(join_mask), assertthat::noNA(join_mask))
assert_that(is.flag(collect), assertthat::noNA(collect))
assert_that(is.flag(obswells), assertthat::noNA(obswells))
assert_that(is.flag(filterdepth_guess), assertthat::noNA(filterdepth_guess))
assert_that(is.flag(filterdepth_na), assertthat::noNA(filterdepth_na))

obswell_aggr <- match.arg(obswell_aggr)

Expand Down Expand Up @@ -822,8 +822,8 @@ get_xg3 <- function(locs,
msg = "startyear must not be larger than endyear.")
assert_that("loc_code" %in% colnames(locs),
msg = "locs does not have a column name 'loc_code'.")
assert_that(is.flag(truncated), noNA(truncated))
assert_that(is.flag(collect), noNA(collect))
assert_that(is.flag(truncated), assertthat::noNA(truncated))
assert_that(is.flag(collect), assertthat::noNA(collect))

if (inherits(locs, "data.frame")) {
locs <-
Expand Down Expand Up @@ -1112,8 +1112,8 @@ get_chem <- function(locs,
en_range[1] >= -1,
en_range[2] <= 1
)
assert_that(is.flag(en_exclude_na), noNA(en_exclude_na))
assert_that(is.flag(collect), noNA(collect))
assert_that(is.flag(en_exclude_na), assertthat::noNA(en_exclude_na))
assert_that(is.flag(collect), assertthat::noNA(collect))

if (!is.na(en_fecond_threshold) & !is.null(en_fecond_threshold)) {
assert_that(is.number(en_fecond_threshold),
Expand Down
12 changes: 6 additions & 6 deletions R/selectlocs.R
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ selectlocs_xg3 <- function(data,
}

assert_that(inherits(conditions, "data.frame"))
assert_that(is.flag(verbose), noNA(verbose))
assert_that(is.flag(list), noNA(list))
assert_that(is.flag(verbose), assertthat::noNA(verbose))
assert_that(is.flag(list), assertthat::noNA(list))

assert_that(all(c("xg3_variable",
"statistic",
Expand Down Expand Up @@ -967,8 +967,8 @@ selectlocs_chem <- function(data,
}

assert_that(inherits(conditions, "data.frame"))
assert_that(is.flag(verbose), noNA(verbose))
assert_that(is.flag(list), noNA(list))
assert_that(is.flag(verbose), assertthat::noNA(verbose))
assert_that(is.flag(list), assertthat::noNA(list))

assert_that(all(c("chem_variable",
"statistic",
Expand Down Expand Up @@ -1167,8 +1167,8 @@ selectlocs <- function(data,
}

assert_that(inherits(conditions, "data.frame"))
assert_that(is.flag(verbose), noNA(verbose))
assert_that(is.flag(list), noNA(list))
assert_that(is.flag(verbose), assertthat::noNA(verbose))
assert_that(is.flag(list), assertthat::noNA(list))

assert_that(all(c("variable",
"statistic",
Expand Down
2 changes: 1 addition & 1 deletion R/sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ as_points <- function(df,
assert_that(is.string(yvar))
assert_that(has_name(df, xvar))
assert_that(has_name(df, yvar))
assert_that(is.flag(warn_dupl), noNA(warn_dupl))
assert_that(is.flag(warn_dupl), assertthat::noNA(warn_dupl))

require_pkgs("sf")

Expand Down

0 comments on commit c8bddf7

Please sign in to comment.