filterVars: Filter duplicate variables from findVars

Description Usage Arguments Details Value Examples

View source: R/queryAlspac.R

Description

Filter duplicate variables from findVars

Usage

1

Arguments

x

Output from findVars().

...

Filter terms. The name corresponds to the variable name for which to remove duplicates. Each term is a named vector whose names correspond to columns in 'x'. The values provide patterns for the given column to match.

Details

findVars() may identify multiple variables with the same name. This function can be used to select among these duplicates.

Value

The subset of 'x' that satisfies the supplied filters or that were not provided a filter.

Examples

1
2
3
4
5
6
7
## Not run: 
varnames <- c("kz021","kz011b","ype9670", "c645a")
vars <- findVars(varnames)
vars <- subset(vars, subset=tolower(name) %in% varnames)
vars <- filterVars(vars, kz021=c(obj="^kz"), kz011b=c(obj="^cp", lab="Participant"), c645a=c(cat2="Quest")) 

## End(Not run)

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