Skip to content
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 passthrough for keep_units() when units are not provided #394

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

d-morrison
Copy link

@d-morrison d-morrison commented Feb 14, 2025

fixes #392

@d-morrison d-morrison changed the title fixes #392 add passthrough for keep_units() when units are not provided Feb 14, 2025
@d-morrison d-morrison marked this pull request as ready for review February 14, 2025 10:32
@d-morrison
Copy link
Author

@Enchufa2 I think this covers all the cases we discussed in #392? Hope it's helpful; feel free to discard if not.

Copy link
Member

@Enchufa2 Enchufa2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind adding some details about this usage to the documentation of the function? Also maybe some examples about this random generation with days, years, rates...

if (inherits(try(unit, silent = TRUE), "symbolic_units")) {
set_units(do.call(FUN, list(x, ...)), unit, mode = "standard")
} else {
warning("`x` does not have units.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "wrong unit specification" or something similar? Because the user may have defined unit explicitly and still get it wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

keep_units() with non-units x input
2 participants