WildcardGlobbingVector: Selection of elements by wildcard/globbing

Description Usage Arguments Value Author(s) Examples

View source: R/PatternMatching.R

Description

Selection of elements by wildcard/globbing

Usage

1
WildcardGlobbingVector(x, wg, negSign = "-", invert = "!")

Arguments

x

Character vector

wg

Character vector with wildcard/globbing

negSign

Character representing selection to be removed

invert

Character to invert each single selection.

Value

vector with selected elements of x

Author(s)

Øyvind Langsrud

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(precip)
x <- names(precip)

# Select the cities starting with B, C and Sa.
WildcardGlobbingVector(x, c("B*", "C*", "Sa*"))

# Remove from the selection cities with o and t in position 2 and 4, respectively.
WildcardGlobbingVector(x, c("B*", "C*", "Sa*", "-?o*", "-???t*"))

# Add to the selection cities not having six or more letters.
WildcardGlobbingVector(x, c("B*", "C*", "Sa*", "-?o*", "-???t*", "!??????*"))

statisticsnorway/SSBtools documentation built on Feb. 17, 2020, 7:07 p.m.