From ea5851747304e931e64ebd77b6100594569a0dcb Mon Sep 17 00:00:00 2001 From: gisler Date: Tue, 26 Dec 2023 18:46:11 +0100 Subject: [PATCH] fix: lintr annotations --- R/RPhosFate.R | 2 +- R/input.R | 6 +++--- R/utils.R | 2 +- inst/tinytest/test_gettersSetters.R | 2 +- inst/tinytest/test_highLevelInterface.R | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/R/RPhosFate.R b/R/RPhosFate.R index c0132ce..fe687dd 100644 --- a/R/RPhosFate.R +++ b/R/RPhosFate.R @@ -92,7 +92,7 @@ setMethod( x@erosion@rl_LFa <- lapp( c(x = rl_acc_wtd_ovl, y = rl_LFa_m), fun = function(x, y) { - ((x * is_res)^(1 + y) - ((x - 1) * is_res)^(1 + y)) / # nolint + ((x * is_res)^(1 + y) - ((x - 1) * is_res)^(1 + y)) / (is_res * 22.13^y) }, cores = x@is_ths diff --git a/R/input.R b/R/input.R index 8065849..ee255a9 100644 --- a/R/input.R +++ b/R/input.R @@ -162,7 +162,7 @@ DEMrelatedInput <- function( ls_tmp = FALSE ) { if (!requireNamespace("whitebox", quietly = TRUE) || - packageVersion("whitebox") < package_version("2.0.0")) { + packageVersion("whitebox") < package_version("2.0.0")) { stop( 'Package "whitebox" (v2.0.0 or higher) must be installed for this ', "functionality.", @@ -403,14 +403,14 @@ DEMrelatedInput <- function( } if (!is.null(cs_rds)) { - rl_dir_rds <- lapp( + lapp( c( x = rl_dir_tau, y = rast("cha.tif"), z = rl_rds ), fun = function(x, y, z) { - ifelse(is.na(y), ifelse(is.na(z), x, NA_integer_), x) + ifelse(is.na(y), ifelse(is.na(z), x, NA_integer_), x) # nolint }, cores = is_ths, filename = "dir_tau_rds.tif", diff --git a/R/utils.R b/R/utils.R index 6d8e4c5..106d1a6 100644 --- a/R/utils.R +++ b/R/utils.R @@ -157,7 +157,7 @@ slots2list <- function(parameters) { writeLayer <- function(cmt, layer, rl, datatype, substance = NULL) { if (length(cmt@is_MCi) == 0L || (length(cmt@is_MCi) == 1L && - layer %in% cmt@cv_MCl)) { + layer %in% cmt@cv_MCl)) { if (!is.null(substance)) { layer <- sub("^xx", tolower(substance), layer) } diff --git a/inst/tinytest/test_gettersSetters.R b/inst/tinytest/test_gettersSetters.R index 7dd1778..297cd1a 100644 --- a/inst/tinytest/test_gettersSetters.R +++ b/inst/tinytest/test_gettersSetters.R @@ -13,7 +13,7 @@ x <- RPhosFate( ls_ini = TRUE ) -source("parameters.R", local = TRUE) # nolint +source("parameters.R", local = TRUE) #### getLayer and [ extract operator #### layers <- list.files( diff --git a/inst/tinytest/test_highLevelInterface.R b/inst/tinytest/test_highLevelInterface.R index a5e8191..05c961a 100644 --- a/inst/tinytest/test_highLevelInterface.R +++ b/inst/tinytest/test_highLevelInterface.R @@ -13,7 +13,7 @@ x <- RPhosFate( ls_ini = TRUE ) -source("parameters.R", local = TRUE) # nolint +source("parameters.R", local = TRUE) #### RPhosFate and catchment #### y <- do.call(RPhosFate, parameters)