View source: R/tidy-select-leverage.R
vselect | R Documentation |
A wrapper around the tidyselect functions that allows to use them not only on data.frames but on vectors as well.
vselect(input, ..., out.fail = base::character(0))
lselect(lst, ..., out.fail = base::list())
input |
A character vector or a factor. |
... |
Additional selection helpers from the |
out.fail |
Output if no content remains after tidyselection has been tried. |
lst |
A named list. (Unnamed elements are discarded.) |
A subsetted version of the input.
vselect()
selects by element. lselect()
selects by element name.
starts_with()
, ends_with()
, contains()
, matches()
library(datasets)
library(confuns)
vec <- c("apple", "banana", "pineapple", "tomato")
vselect(vec, contains("apple") | ends_with("o"))
lst <- list(a = mtcars, ab = iris, ac = cars)
lselect(lst, starts_with("a") & !ends_with("c"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.