Skip to content

Commit

Permalink
data.table: R CMD check-safe .() -> list() and define "undefined glob…
Browse files Browse the repository at this point in the history
…als" as null locally #157 #174
  • Loading branch information
brownag committed Jan 20, 2021
1 parent eb497f7 commit 8f40d39
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions R/checkHzDepthLogic.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
checkHzDepthLogic <- function(x, fast = FALSE) {

stopifnot(inherits(x, 'SoilProfileCollection'))

h <- data.table::as.data.table(horizons(x))
hzd <- horizonDepths(x)
idn <- idname(x)
Expand All @@ -54,10 +53,13 @@ checkHzDepthLogic <- function(x, fast = FALSE) {

res <- NULL

# data.table R CMD check
tests <- NULL

if (!fast) {

res <- h[, .(tests = list(tests = data.frame(t(hzDepthTests(eval(top), eval(bottom)))))), by = c(eval(hby))][,
.(tests = tests, valid = all(!tests[[1]])), by = c(eval(hby))]
res <- h[, list(tests = list(tests = data.frame(t(hzDepthTests(eval(top), eval(bottom)))))), by = c(eval(hby))][,
list(tests = tests, valid = all(!tests[[1]])), by = c(eval(hby))]

res <- cbind(res, data.table::rbindlist(res$tests))
res$tests <- NULL
Expand Down

0 comments on commit 8f40d39

Please sign in to comment.