glob: Select helper to select variables based on name glob pattern.

Description Usage Arguments Details Value

View source: R/select_helpers.R

Description

Like matches, this function selects variables by by name. However, it uses wildcard, aka globbing patterns instead of regular expressions.

Usage

1
glob(pattern, ignore.case = TRUE, vars = current_vars())

Arguments

pattern

Globbing pattern

ignore.case

If TRUE, the default, ignores case when matching names.

vars

A character vector of variable names. When called from inside select() these are automatically set to the names of the table.

Details

Use ? to match a single character, and * to match any number of characters, including none. The pattern is anchored at the start and end of the string, meaning it must start at the start, and end at the the end.

This function uses glob2rx to convert the globbing pattern to a regex,

Value

An integer vector given the position of the matched variables.


jrnold/rubbish documentation built on May 20, 2019, 2:05 a.m.