new_disease_expose: Constructor to Create a 'disease_expose' Object

View source: R/new_disease_expose.R

new_disease_exposeR Documentation

Constructor to Create a disease_expose Object

Description

Creates an object of class disease_expose with the data (all disease and exposure columns must be binary) provided

Usage

new_disease_expose(x, disease, exposures)

Arguments

x

The data.frame containing disease-exposure data

disease

Quoted name or unquoted numeric value of the column containing the disease status data

exposures

The column(s) containing exposure data, either given as a vector of quoted names or unquoted numeric values or a single quoted name or unquoted numeric value (if there is only one exposure)

Value

An object of class disease_expose and data.frame containing binary variables for disease and exposure data

Examples

de_data <- disease_expose_data # use example data from package

cleaned_de_data <- clean_disease_expose(data = de_data, disease = "disease", noDisease = "No", exposures = c("exposure1", "exposure2", "exposure3")) # clean the data

de_object <- new_disease_expose(cleaned_de_data, disease = 1, exposures = 2:8) # make a new disease_expose object

npeters1322/hospEpi documentation built on April 30, 2022, 6:12 p.m.