Learn R Programming

crunch (version 1.9.4)

findVariables: Search a Dataset or list of Variables

Description

A version of grep for Crunch objects

Usage

findVariables(dataset, refs = NULL, pattern = "", key = namekey(dataset),
  ...)

Arguments

dataset
the Dataset or list of Crunch objects to search
refs
vector of specific values in key to look for, as an alternative to pattern matching. Default is NULL, which means to use grep instead.
pattern
regular expression, passed to grep. If "", returns all.
key
the field in the Crunch objects in which to grep
...
additional arguments passed to grep. If value=TRUE, returns the values of key where matches are found, not the variables themselves

Value

  • indices of the Variables that match the pattern, or the matching key values if value=TRUE is passed to grep