From ef0b32dedf155917ee2b8e5d5f4ff0cbd7de66d2 Mon Sep 17 00:00:00 2001 From: chantelwetzel-noaa Date: Thu, 3 Oct 2024 15:54:57 +0000 Subject: [PATCH] style and docs: run devtools::document() and styler::style_pkg() --- R/check_profile_range.R | 4 ++-- R/get_settings.R | 7 ++++--- R/get_settings_profile.R | 3 ++- R/run_profile.R | 4 ++-- man/get_settings.Rd | 7 ++++--- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/R/check_profile_range.R b/R/check_profile_range.R index 3cc3284..2afba39 100644 --- a/R/check_profile_range.R +++ b/R/check_profile_range.R @@ -51,7 +51,7 @@ check_profile_range <- function(mydir, model_settings) { } step_size <- profile_details[["step_size"]] - if((max(range) - min(range)) < step_size) { + if ((max(range) - min(range)) < step_size) { cli::cli_abort( "The step size of {step_size} appears to be set too large to profile over {para} from value of {range[1]} to {range[2]}." @@ -81,7 +81,7 @@ check_profile_range <- function(mydir, model_settings) { if (est %in% vec) { vec <- vec[!vec == est] } - if(model_settings[["verbose"]]) { + if (model_settings[["verbose"]]) { cli::cli_inform( "Profiling over {para} across values of {sort(vec)}." ) diff --git a/R/get_settings.R b/R/get_settings.R index e00297d..c29a582 100644 --- a/R/get_settings.R +++ b/R/get_settings.R @@ -14,9 +14,10 @@ #' #' @examples #' \dontrun{ -#' get_settings( -#' mydir = "directory", -#' settings = list("Njitter" = 10)) +#' get_settings( +#' mydir = "directory", +#' settings = list("Njitter" = 10) +#' ) #' } #' get_settings <- function(mydir = NULL, settings = NULL) { diff --git a/R/get_settings_profile.R b/R/get_settings_profile.R index f221f05..a1d6fa5 100644 --- a/R/get_settings_profile.R +++ b/R/get_settings_profile.R @@ -90,7 +90,8 @@ get_settings_profile <- function(parameters = c("NatM_uniform_Fem_GP_1", "SR_BH_ cli::cli_abort( "Input vectors do match in length. There were {length(parameters)} parameters, {length(low)} lower bounds, {length(high)} high bounds, {length(step_size)} - step sizes, and {length(param_space)} parameter spaces specified.") + step sizes, and {length(param_space)} parameter spaces specified." + ) } if (lifecycle::is_present(use_prior_like)) { diff --git a/R/run_profile.R b/R/run_profile.R index cd3ee1b..8fdffbf 100644 --- a/R/run_profile.R +++ b/R/run_profile.R @@ -129,7 +129,7 @@ run_profile <- function(mydir, model_settings, para) { } step_size <- model_settings[["profile_details"]][["step_size"]] - if((max(range) - min(range)) < step_size) { + if ((max(range) - min(range)) < step_size) { cli::cli_abort( "The step size of {step_size} appears to be set too large to profile over {para} from value of {range[1]} to {range[2]}." @@ -161,7 +161,7 @@ run_profile <- function(mydir, model_settings, para) { } num <- sort(vec, index.return = TRUE)[["ix"]] - if(model_settings[["verbose"]]) { + if (model_settings[["verbose"]]) { cli::cli_inform( "Profiling over {para} across values of {sort(vec)}." ) diff --git a/man/get_settings.Rd b/man/get_settings.Rd index bca1d7c..2899602 100644 --- a/man/get_settings.Rd +++ b/man/get_settings.Rd @@ -25,9 +25,10 @@ Check that all of the settings are in the list } \examples{ \dontrun{ - get_settings( - mydir = "directory" - settings = list("Njitter" = 10)) +get_settings( + mydir = "directory", + settings = list("Njitter" = 10) +) } }