Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
Remove duplicated function (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
maurolepore authored Nov 24, 2020
1 parent 11df86e commit cda2fd4
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions R/get_param.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,3 @@ pluck_param <- function(x, file, if_null) {
out
}

pluck_param <- function(x, file, if_null) {
out <- purrr::pluck(config::get(file = file), !!!x)
param <- ui_field(dplyr::last(unlist(x)))

if (is.null(out) && identical(if_null, stop)) {
abort(glue(
"{param} must be not `NULL`.
Please set {param} on the configuration (.yml) file."
))
}

if (is.null(out) && !is.null(if_null)) {
param_ <- ui_field(param)
warn(glue("On config.yml, {param} is undefined."))

if_null_ <- ui_field(if_null)
inform(glue("Setting {param_} to default value: {if_null_}."))
out <- if_null
}

out
}

0 comments on commit cda2fd4

Please sign in to comment.