-
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
Using named arguments at ...
#156
Comments
You have to pass the library("glue")
f <- function(...) {
print(glue("{a} + {b}", ...))
sum(...)
}
f(a = 2, b = 3)
#> 2 + 3
#> [1] 5 Created on 2019-11-19 by the reprex package (v0.3.0) |
Oh, sorry. Thanks! |
But you can't nested call. library("glue")
g <- function(...) {
f(...)
}
f <- function(...) {
print(glue("{a} + {b}"))
sum(...)
}
g(a = 2, b = 3)
# Error in eval(parse(text = text, keep.source = FALSE), envir) :
# object 'a' not found |
You have to pass the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tried to use the dots in a function and then use the named arguments in glue but I couldn't make it work.
Perhaps this is related to #137 but I couldn't find if it is possible or not.
Created on 2019-11-19 by the reprex package (v0.3.0)
I tried some variations with setting other environments but I didn't manage to make it work. Is this behaviour considered for glue?
The text was updated successfully, but these errors were encountered: