findvarname | R Documentation |
List variable names / vector items which match a search expression
findvarname(pattern, data = NULL)
fvn(data, pattern)
## S3 method for class 'data.frame'
fvn(data, pattern)
## Default S3 method:
fvn(data, pattern)
fv(data, pattern)
pattern |
A character string regex search expression |
data |
A data.frame object |
findvarname
is a legacy function specific to data.frames. The fvn
function works for character vectors and data.frames. If the input is a data.frame, the matching variable names are sorted into alphabetical order. If the input is a character vector, the values are returned in the original order.
The function fv
allows for non-standard evaluation, i.e., the search pattern does not need to be in quotes.
findvarname("length", iris)
fvn(iris, "Sepal")
fvn(sample(letters,125, replace = TRUE), "A|G")
iris %>% fv(Sepal)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.