getVariableDataByPhvAcc: (internal) Get variable data by accession

Description Usage Arguments Value Methods (by class) Examples

Description

The method returns the data frame of merged data of given dbGaP variable accessions. The variables need to belong to the same study. Only the data of subject level variables can be returned by this function.

Usage

1
2
3
4
5
6
getVariableDataByPhvAcc(object, phvAccList, ...)

## S4 method for signature 'Study,character'
getVariableDataByPhvAcc(object, phvAccList, ...,
  dataStudyOnly = TRUE, cleanNumVal = FALSE, emptyToNa = FALSE,
  colNameWithAcc = FALSE, checkList = T)

Arguments

object

Study class object.

phvAccList

a character vector. The dbGaP variable accessions.

...

There are optional arguments.

dataStudyOnly

a logical value. When TRUE (default), only downloads the dataset and variable metadata of the stdudies that have data files in the project directory. When FALSE, downloads the dataset and variable metadata of all dbGaP released studies, regardless the actual phenotype data files of the studies are downloaded or not.

cleanNumVal

a logical value. (optional). If TRUE, from numeric variables, converts non-numeric values to NA. If FALSE (default), not convert.

emptyToNa

a logical value. (optional). If TRUE, converts the empty values to NA; If FALSE (default), not convert.

colNameWithAcc

a logical value. (optional). If TRUE, includes the variable accessions in the column names (e.g. AGEPHOT_phv00000027.v2); If FALSE, not include (e.g. AGEPHOT).

checkList

a logical value. (optional). If TRUE, validate the input variable accessions. Skip the check if FALSE.

Value

a data frame. Merged data of input variables.

Methods (by class)

Examples

1
2
3
4
5
6
7
## Not run: 

s <- Study(phsAcc = 'phs000001.v3.p1')
var_list <- c('phv00054119.v1.p1.c2', 'phv00054118.v1.p1', 'phv00053733.v2')
getVariableDataByPhvAcc(s, phvAccList = var_list)

## End(Not run)

jameslhao/dbgapr_dev documentation built on May 8, 2019, 11:03 p.m.