-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
export formatters functions #165
Conversation
Code Coverage Summary
Diff against main
Results for commit: cfc6a97 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Is it okey to have similar functions in different packages? In |
#' x <- formatters_with_label(c(1, 2, 3), label = "Test") | ||
#' obj_label(x) | ||
formatters_with_label <- function(x, label) { | ||
obj_label(x) <- label |
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.
@gogonzo do you think we also need to include obj_label
from formatters
https://github.com/insightsengineering/formatters/blob/ffa09bb46eb28a9e269847b918c14c719c5d28b5/R/generics.R#L261C1-L283C2 ? Looks like it's a wrapper around S3 and S4 at the same time, where for S4 it uses standardGeneric and for S3 it just calls attr(x, "label")
. I think in teal packages we focus on S3, so rewriting obj_label(x) <- label
to attr(x, "label") <- label
should be enough
at https://github.com/insightsengineering/coredev-tasks/issues/447 we decided to move those functions to teal.data insightsengineering/teal.data#155 |
Part of https://github.com/insightsengineering/coredev-tasks/issues/447