View source: R/PatternMatching.R
WildcardGlobbingVector | R Documentation |
Selection of elements by wildcard/globbing
WildcardGlobbingVector(x, wg, negSign = "-", invert = "!")
x |
Character vector |
wg |
Character vector with wildcard/globbing |
negSign |
Character representing selection to be removed |
invert |
Character to invert each single selection. |
vector with selected elements of x
Øyvind Langsrud
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*", "!??????*"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.