-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Extend examples and see also of sprintf_format function #269
Conversation
Code Coverage Summary
Diff against main
Results for commit: ba13221 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Unit Tests Summary 1 files 5 suites 9s ⏱️ Results for commit ba13221. ♻️ This comment has been updated with latest results. |
Check fails at library load which is required for the example. I believe the formatters won't import the package but I'll do further tests. If I am not able to use In addition, this part of the issue is somewhat unclear to me 'It is also necessary imo to have a short explanation at the end of function call list_valid_format* that explains the possibility to use dynamic function calls to set the format.'. The function |
Do not use rtables from formatters as it would result in circular dependencies
This issue needs to have documentation for the various sprintf and round formats that we added or can add when format is a function. Indeed, you can use this to change everything that is printed out and we lack documentation for this powerful feature |
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.
We need to add information about the various possible formats in ?list_valid_format_labels()
and in {rtables} with a looot of examples. If you do ?rtables::analyze
you will find the format parameter defined as such:
format | FormatSpec. Format associated with this split. Formats can be declared via strings ("xx.x") or function. In cases such as analyze calls, they can character vectors or lists of functions.
But as you can see there are no links to other docs or functions that lists useful formats. We should enhance the network of @seealso
by adding these info in a common place (I would opt for ?list_formats
) that is linked from many {rtables} functions (the one that have format as argument ideally, while list_formats keeps connection to other formatting functions. Final examples (not to have circular deps) should live in a dedicated vignette in {rtables} along with the format handling/precedence
@martincadek remember to run the styler from rstudio, so you avoid having annoying lintr issues ;) |
Thank you for the reviews so far - working on this to have it resolved today. |
CLA Assistant Lite bot ✅ All contributors have signed the CLA |
I have read the CLA Document and I hereby sign the CLA |
@@ -119,14 +119,19 @@ check_aligns <- function(algn) { | |||
#' @export | |||
#' @return A formatting function which wraps and will apply the specified \code{printf} style format | |||
#' string \code{format}. | |||
#' @seealso \code{\link[base]{sprintf}} | |||
#' | |||
#' @seealso \code{\link[base]{sprintf}} [round_fmt()] \code{link{list_formats}} |
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.
@martincadek could you make it all [fnc()] please? Also can you go in the other functions and see that they have some good connection with this one? otherwise it remains difficult to reach
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.
I think there should also be a counterpart in {rtables} with links to these in some of the obscure description of parameters. All of this would make a nice extension of the current vignette on format precedence
Closing this as outdated |
Closes #141
Related to insightsengineering/rtables#611