get.filtered: Filter Data given series of filter commands

Description Usage Arguments Details Value Examples

View source: R/load-data.R View source: R/load-data copy.R

Description

This function is a helper function to take a series of filter instructions (from the filters.csv file) and uses them to filter a tibble of study data.

Usage

1

Arguments

data

The Tibble of Data from Study to be Filtered

filts

The list of file path(s) to filters.csv. Most likely a list of length 1.

Details

This command writes an intermediate csv file to the working directory, named filres.csv. This intermediate file stores the data about how many subjects were filtered by each condition. This data is later used to create consort diagrams.

Value

returns a filtered tibble of study data. Does not do any error checking.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 

filts <- '~/proteomics/filters.csv'
data  <- haven::read_dta('~/proteomics/studydata.dta')

filtered.data <- get.filtered(data, filts)

OR

data <- haven::read_dta('~/proteomics/studydata.dta') %>%
    get.filtered('~/proteomics/filters.csv')


## End(Not run)

pranavdorbala/proteomicsHF documentation built on March 9, 2021, 12:22 a.m.