This simple solution would be to select the positive columns and then compare the names to find out which columns should be discarded, as in this answer .
To work with points directly,
- We will write them in the quosures (
quos
) list . UQS
.c()
, .- .
, (3) (4).
library(dplyr)
dots <- quos(a, b)
quos(-c(UQS(dots)))
#> [[1]]
#> <quosure: frame>
#> ~-c(~a, ~b)
#>
#> attr(,"class")
#> [1] "quosures"
test <- data.frame(a = 1:3, b = 1:3, c = 1:3)
testfun <- function(x, ...) {
dots <- quos(...)
y <- select(x, UQS(dots))
z <- select(x, -c(UQS(dots)))
return(list(y, z))
}
testfun(test, a)
testfun(test, a, b)
.
testfun(test, starts_with("b"), one_of("c"))