-
Notifications
You must be signed in to change notification settings - Fork 140
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
FR: add env
argument to is_missing()
#1715
Comments
I think I'd rather fix either |
I edited my post to show the proper FR demand. |
The C API of R is about to gain an So I think we could expose this on the R level, and you could use that to detect missing arguments in a caller frame. We could add individual variants too, such as: env_has_missing <- function(env, nm) {
env_binding_type(env, nm) == "missing"
} But I'm not sure we want to add so many predicates. |
Hi,
In some cases, it can be interesting to know if an argument is missing from the caller frame.
For instance, I'd like to propose a standard way to handle arguments through options when they are missing. Here, being able to check the missingness from inside a helper would be very handy.
Here is a reprex with a clumsy workaround:
Created on 2024-05-30 with reprex v2.1.0
Note that
is_miss_bad()
would actually work fine ifa
didn't have a default value.Would you consider adding this feature to
rlang::is_missing()
?The text was updated successfully, but these errors were encountered: