diff --git a/.Rprofile b/.Rprofile index 51ad0fdc..8c408fd6 100644 --- a/.Rprofile +++ b/.Rprofile @@ -1,8 +1,7 @@ # Set renv profile base on R version. .get_dependencies <- function(project_dir) { - admdev_loc <- find.package("admiraldev", lib.loc = .libPaths(), quiet = TRUE) - adm_dev_suggests <- if(length(admdev_loc) != 0) { + adm_dev_suggests <- if (length(admdev_loc) != 0) { renv:::renv_dependencies_discover_description(admdev_loc, fields = c("Depends", "Imports", "LinkingTo", "Suggests")) } else { data.frame(Packages = character(0)) diff --git a/NEWS.md b/NEWS.md index 8511f714..97bfa637 100644 --- a/NEWS.md +++ b/NEWS.md @@ -25,6 +25,7 @@ - Updated unit testing vignette with snapshot testing guidance. (#302) - Documentation of `friendly_type_of()` was provided (#22) - Minor updates to pull request review guidance were added (#201, #292) +- Documentation of singular versus plural function argument names was added into the programming strategy vignette. Also documentation on the common arguments `missing_value` and `missing_values` was added. (#296) ## Various diff --git a/vignettes/programming_strategy.Rmd b/vignettes/programming_strategy.Rmd index 775b3c5c..1bf4101a 100644 --- a/vignettes/programming_strategy.Rmd +++ b/vignettes/programming_strategy.Rmd @@ -205,6 +205,7 @@ added, it should be `param.` For example: `new_var`, `new_var_unit`, Arguments which expect a boolean or boolean vector must start with a verb, e.g., `is_imputed` or `impute_date`. +Arguments which only expect one value or variable name must be a singular version of the word(s), e.g., `missing_value` or `new_var`. Arguments which expect several values or variable names (as a list, expressions, etc.) must be a plural version of the word(s), e.g., `missing_values` or `new_vars`. ## List of Common Arguments @@ -225,6 +226,8 @@ Arguments which expect a boolean or boolean vector must start with a verb, e.g., | `set_values_to` | List of variable name-value pairs. Use `process_set_values_to()` for processing the value and providing user friendly error messages. | | `subject_keys` | Variables to uniquely identify a subject, defaults to `exprs(STUDYID, USUBJID)`. In function formals, use `subject_keys = get_admiral_option("subject_keys")` | | `keep_source_vars` | Specifies which variables from the selected observations should be kept. The default of the argument should be `everything()`. | +| `missing_value` | A singular value to be entered if the data is missing. | +| `missing_values` | A named list of expressions where the names are variables in the dataset and the values are a value to be entered if the data is missing, e.g., `exprs(BASEC = "MISSING", BASE = -1)`. | ## Source Code Formatting