Skip to contents

Small helper function to select values from a character vector, based on regular expressions.

Usage

vector_select(x, include = NULL, exclude = NULL)

Arguments

x

A character vector.

include

Optional. If provided, will only include vector elements that match this regular expression.

exclude

Optional. If provided, will exclude vector elements that match this regular expression.

Value

A character vector.

Examples

vector_select(names(iris), include = "Sepal", exclude = "Width")
#> [1] "Sepal.Length"