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

Concatenation of a quosure and a list of quosure is not interchangeable #1446

Closed
DanChaltiel opened this issue Jul 22, 2022 · 1 comment
Closed

Comments

@DanChaltiel
Copy link

Hi,

This is probably a quibbling corner case of minor importance but it seems that the concatenation of quo() and quos() depends on the order of the operation:

cols = rlang::quo(c(mpg, gear))
dots = rlang::quos(cyl, am)

class(cols)
#> [1] "quosure" "formula"
class(dots)
#> [1] "quosures" "list"
class(c(dots, cols))
#> [1] "quosures" "list"
class(c(cols, dots))
#> [1] "list"

Created on 2022-07-22 by the reprex package (v2.0.1)

In the latter case, the quosures class is lost but I'm not sure that this class is important or if this can cause any trouble at all.

This is obviously caused by the absence of rlang:::c.quosure() but the result is a bit unexpected. Maybe c.quosures() could be aliased to c.quosure()?

@lionel-
Copy link
Member

lionel- commented Jul 22, 2022

I'm pretty sure this should be an error in all cases so can you please use c(list(quo), quos) instead?

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

No branches or pull requests

2 participants