-
Notifications
You must be signed in to change notification settings - Fork 64
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 #2510 enhance derive param computed #2544
Conversation
_pkgdown.yml
Outdated
@@ -1,6 +1,7 @@ | |||
url: https://pharmaverse.github.io/admiral | |||
|
|||
template: | |||
math-rendering: mathjax |
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.
is this intentional? Just checking!?! :)
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.
Yes, I rendered the documentation with pkgdown 2.1.1 and noticed that formulas are no longer rendered correctly. Adding this line fixes the issues.
@yurovska does this meet your needs for this function? |
@bms63 @bundfussr Yes, sort of... It indeed gives a possibility to do what I wanted to do as described in the issue. However, users might still be falling into a trap if advs <- tribble(
~USUBJID, ~PARAMCD, ~PARAM, ~AVAL, ~AVALU, ~VISIT, ~TESTVAR,
"01-701-1015", "HEIGHT", "Height (cm)", 147.0, "cm", "SCREENING", NA_character_,
"01-701-1015", "WEIGHT", "Weight (kg)", 54.0, "kg", "SCREENING", NA_character_,
"01-701-1015", "WEIGHT", "Weight (kg)", 54.4, "kg", "BASELINE", NA_character_,
"01-701-1015", "WEIGHT", "Weight (kg)", 53.1, "kg", "WEEK 2", NA_character_,
"01-701-1028", "HEIGHT", "Height (cm)", 163.0, "cm", "SCREENING", NA_character_,
"01-701-1028", "WEIGHT", "Weight (kg)", 78.5, "kg", "SCREENING", NA_character_,
"01-701-1028", "WEIGHT", "Weight (kg)", 80.3, "kg", "BASELINE", NA_character_,
"01-701-1028", "WEIGHT", "Weight (kg)", 80.7, "kg", "WEEK 2", NA_character_
)
derive_param_computed(
dataset = advs,
by_vars = exprs(USUBJID, VISIT),
parameters = "WEIGHT",
set_values_to = exprs(
AVAL = AVAL.WEIGHT / (AVAL.HEIGHT / 100)^2,
AVALU = "kg/m^2",
PARAMCD = "BMI",
PARAM = "Body Mass Index (kg/m^2)",
TESTVAR = TESTVAR.WEIGHT
),
constant_parameters = c("HEIGHT"),
constant_by_vars = exprs(USUBJID)
)
Shall |
Yes, good idea. |
Awesome. It is much more clear for the user now. Thanks a lot! No more comments from my side. Good job @bundfussr! |
Thank you for your Pull Request! We have developed this task checklist from the Development Process Guide to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the admiral codebase remains robust and consistent.
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
main
branch until you have checked off each task.styler::style_file()
to style R and Rmd filesinst/cheatsheet/admiral_cheatsheet.pptx
and re-upload a PDF and a PNG version of it to the same folder. (The PNG version can be created by taking a screenshot of the PDF version.)devtools::document()
so all.Rd
files in theman
folder and theNAMESPACE
file in the project root are updated appropriatelyNEWS.md
under the header# admiral (development version)
if the changes pertain to a user-facing function (i.e. it has an@export
tag) or documentation aimed at users (rather than developers). A Developer Notes section is available inNEWS.md
for tracking developer-facing issues.pkgdown::build_site()
and check that all affected examples 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()