Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #296 document_missing_value_s@devel #311

Merged
merged 9 commits into from
Aug 9, 2023
3 changes: 1 addition & 2 deletions .Rprofile
Original file line number Diff line number Diff line change
@@ -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))
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions vignettes/programming_strategy.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down