-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
if_then_else support via "conditioned" data frames (#55)
* Basic support for "conditioned" data frames - Adds a new S3 class (cnd_df) for represented conditioned data frames, i.e. data frames that carry metadata about what records should be used for derivations - Adds support for basic pretty printing of cnd_df objects - Adds a user-facing function for creating such cnd_df objects: `condition_by` - Adds experimental "mutate"-version function for these conditioned data frames: `derive_by_condition()` * Basic support for conditioned data sets * Extensive support for conditioned tibbles - Joins by raw and target data sets are now aware of conditioned tibbles - Transformation functions, namely `assign_datetime()`, `hardcode*()` and `assign*` are also conditioned-tibble aware - Unit test coverage for most cases indicated at #54 I believe the essential components are here to support the if_then_else algorithm via conditioned tibbles. Now, further testing, assertions and documentation is needed. * Ramm's feedback integration - Move `tgt_dat` to the first position in the argument list for cleaner command pipes. - Rename `condition_by()` to `condition_add()`. - Export `oak_id_vars()` for direct user access. - Update tidyselections to align with the latest practices. * Update on conditioned data frames - Documentation - Examples - New article about cnd_df (WIP) * Styling fixes * Update linting and styling * Tidying up - No need for S3 methods to be exported - `condition_add()` now links to the appropriate article about conditioned data frames - Documentation tweaks - Version bump, NEWS update and pkgdown reference list update * Last tweaks - Add example for `condition_add()` - Re-export S3 methods for `cnd_df` - Update pkgdown reference list * Remove blank line * Tweaks to `%.>%` docs * Automatic renv profile update. --------- Authored-by: ramiromagno <[email protected]>
- Loading branch information
1 parent
e1aa479
commit 13644bd
Showing
55 changed files
with
2,314 additions
and
760 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: sdtm.oak | ||
Type: Package | ||
Title: SDTM Data Transformation Engine | ||
Version: 0.0.0.9004 | ||
Version: 0.0.0.9005 | ||
Authors@R: c( | ||
person("Rammprasad", "Ganapathy", role = c("aut", "cre"), | ||
email = "[email protected]"), | ||
|
@@ -46,9 +46,12 @@ Imports: | |
tibble, | ||
vctrs, | ||
readr, | ||
glue | ||
glue, | ||
pillar | ||
Suggests: | ||
knitr, | ||
lifecycle, | ||
magrittr, | ||
rmarkdown, | ||
spelling, | ||
testthat (>= 3.1.7) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Surprisingly, admiraldev doesn't provide `assert_logical_vector`. | ||
assert_logical_vector <- function(arg, optional = FALSE) { | ||
if (optional && is.null(arg)) { | ||
return(invisible(arg)) | ||
} | ||
|
||
if (!is.logical(arg)) { | ||
err_msg <- sprintf( | ||
"`arg` must be a logical vector but is %s.", | ||
admiraldev::what_is_it(arg) | ||
) | ||
rlang::abort(err_msg) | ||
} | ||
|
||
invisible(arg) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.