-
-
Notifications
You must be signed in to change notification settings - Fork 0
add new mode
argument
#182
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
base: main
Are you sure you want to change the base?
Conversation
Code Coverage Summary
Diff against main
Results for commit: 37d96e5 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Unit Tests Summary 1 files 14 suites 2s ⏱️ Results for commit 37d96e5. ♻️ This comment has been updated with latest results. |
Unit Test Performance DifferenceAdditional test case details
Results for commit 4c5834a ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Introduce a new mode argument to log_filter to control whether related tables are also filtered, plus documentation updates and tests.
- Add mode parameter to log_filter.list with values "all" or "unique"
- Update documentation for log_filter and reformat; add tests for new behavior
- Bump RoxygenNote
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 11 comments.
Show a summary per file
File | Description |
---|---|
R/filter.R | Implements mode in log_filter.list, adds argument validation, and generalizes cross-table filtering beyond adsl |
tests/testthat/test-filter.R | Adds tests for mode = "all" and mode = "unique" behavior |
man/log_filter.Rd | Documents new mode parameter and updates details |
R/reformat.R | Expands function description/comments for reformat |
man/reformat.Rd | Updates description and adds vignette reference |
man/get_arg.Rd | Simplifies example preamble in dontshow block |
NEWS.md | Notes new mode feature |
DESCRIPTION | Updates RoxygenNote |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
expect_equal(nrow(res$dfb), 4) | ||
expect_equal(nrow(res$adsl), 4) | ||
|
||
res <- expect_silent(log_filter(df_raw, c >= 7, "dfb", by = "USUBJID", mode = "unique")) | ||
expect_equal(nrow(res$dfb), 4) | ||
expect_equal(nrow(res$adsl), 10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you could show the attribute that was filtered out/in?
log_filter.list <- function(data, condition, table, by = c("USUBJID", "STUDYID"), suffix = NULL, verbose = FALSE, ...) { | ||
log_filter.list <- function(data, | ||
condition, | ||
table, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be adsl as default maybe?
#' @param ... further arguments to be passed to or from other methods. | ||
#' @returns a `data.frame` or `list` of `data.frame` filtered for the provided conditions. | ||
#' @details |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#' @param ... further arguments to be passed to or from other methods. | |
#' @returns a `data.frame` or `list` of `data.frame` filtered for the provided conditions. | |
#' @details | |
#' @param ... further arguments to be passed to or from other methods. | |
#' | |
#' @returns a `data.frame` or `list` of `data.frame` filtered for the provided conditions. | |
#' | |
#' @details |
#' in table (using by), or `mode = "unique"` to leave other tables unchanged. | ||
#' @export |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#' in table (using by), or `mode = "unique"` to leave other tables unchanged. | |
#' @export | |
#' in table (using by), or `mode = "unique"` to leave other tables unchanged. | |
#' | |
#' @export |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just for readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm! Just few minors. Thanks Benoit
Add a
mode
argument tolog_filter
to make the function more flexible.reformatting
documentation (see Documentation unclear for reformats #181)thank you for the review