-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add test case for baseline_timepoints
in derive_blfl
function
#95
Conversation
@edgar-manukyan @ramiromagno May I request your review of this small MR? Thanks in advance |
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.
Hi @ShiyuC:
When it comes to this PR specifically, I think that the changes are working as expected.
I took a look at the function code itself and there are a few things I personally think should be improved (but this might be addressed on a separate issue or not... I leave it up to you, Edgar and Ramm to decide)
- ISO 8601 formatted dates are being used as character and not as date-times on their own right. This means that date and time comparisons are being done lexicographically, which I find dangerous (even though I understand the measures taken at
dtc_datepart()
anddtc_timepart()
to make sure the format is comparable). - Using dplyr verbs (
dplyr::mutate()
,dplyr::na_if()
,tidyr::drop_na()
) to make code more readable here:bad_orres_rows <- is.na(ds_mod[[domain_prefixed_names["orres"]]]) | trimws(ds_mod[[domain_prefixed_names["orres"]]]) %in% c("ND", "NOT DONE", "") ds_mod <- ds_mod[!bad_orres_rows, ]
- I think there is a bug in line 355,
var_tpt
->tpt
con_col <- c(domain_prefixed_names[c("testcd", "dtc", "var_tpt")], "VISIT")
- Not that I think it makes a difference in the resulting computations, but it would be more human-readable, I would change
sdtm_in
tods_mod
:con_col <- con_col[con_col %in% names(sdtm_in)]
- Is the setting of
<unspecified>
something that is part of the SDTM standard? - Replace
rbind()
with dplyr's equivalent - Replace
dplyr::arrange_at()
witharrange()
as the former is superseded. - Replace the pattern
get(domain_prefixed_names["tpt"])
by idiomatic rlang alternatives, e.g.!!rlang::sym(...)
or{{...}}
.
Thanks team. Shall we add a new issue with Ramiro's nice findings/suggestions and refactor the derive_blfl in that issue? |
We can probably add these comments to issue #59 |
Ram's comment: add example for baseline_timepoints |
Merge remote-tracking branch 'origin/main' into 59-tmpt-test # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
|
This PR touches #59, bullet point 3.
baseline_timepoints
.Please check off each taskbox as an acknowledgment that you completed the task
or check off that it is not relevant to your Pull Request. This checklist is
part of the Github Action workflows and the Pull Request will not be merged into
the
devel
branch until you have checked off each task.Request Title (Use Edit button in top-right if you need to update)
tidyverse style guide. Run
styler::style_file()
to style R and Rmd filesconsider realistic data scenarios and edge cases, e.g. empty datasets, errors,
boundary cases etc. - See
Unit Test Guide
fully follow the
deprecation guidance?
and families. Refer to the
categorization of functions to tag appropriate keyword/family.
devtools::document()
so all.Rd
files in theman
folder and theNAMESPACE
file in the project root are updated appropriatelyNEWS.md
if the changes pertain to a user-facing function (i.e. ithas an
@export
tag) or documentation aimed at users (rather than developers)pkgdown::build_site()
and check that all affectedexamples are displayed correctly and that all new functions occur on the "Reference" page.
lintr::lint_package()
R CMD check
locally and address all errors and warnings -devtools::check()