findVars: Find variables

Description Usage Arguments Details Value Examples

View source: R/queryAlspac.R

Description

Provide a list of search terms to find variables in the data dictionary.

Usage

1
2
findVars(..., logic = "any", ignore.case = TRUE, perl = FALSE,
  fixed = FALSE, whole.word = FALSE, dictionary = "both")

Arguments

...

Search terms

logic

Conditions for the search strings, can be "all", "any", or "none". Set to "any" by default.

ignore.case

Should search terms be case sensitive? Defaults to TRUE.

perl

logical. Should perl-compatible regexps be used? Defaults to FALSE.

fixed

logical. If 'TRUE', 'pattern' is a string to be matched as is. Overrides all conflicting arguments. Defaults to FALSE.

whole.word

If 'TRUE' search term "word" will be changed to "\bword\b" to only match whole words. Defaults to FALSE.

dictionary

Data frame or name of a data dictionary. Dictionaries available by default are "current" (from the R:/Data/Current folder), "useful" (from the R:/Data/Useful_data folder) and "both" (combined "current" and "useful"). New dictionaries can be created using the createDictionary() function. (Default: "both").

Details

The resulting data frame will have the following columns:

Value

A data frame containing a list of the variables, the files they originate from, and some descripton about the files

Examples

1
2
3
4
5
## Not run: 
# Find variables with BMI or height in the description (this will return a lot of results!)
bmi_variables <- findVars("bmi", "height", logic="any", ignore.case=TRUE)

## End(Not run)

explodecomputer/alspac documentation built on Sept. 14, 2020, 1:10 a.m.