View source: R/clean_disease_expose.R
clean_disease_expose | R Documentation |
Takes disease-exposure data and makes all columns binary, which is needed to use other functions in the package
clean_disease_expose(data, disease, noDisease = NULL, exposures)
data |
The |
disease |
Quoted name or unquoted numeric value of the column containing the disease status data |
noDisease |
Optional, with a default of NULL. A quoted string specifying how disease status equal to not diseased is listed in the disease column. |
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) |
A data.frame containing binary variables for disease and exposure data
de_data <- disease_expose_data # read in example data provided in package cleaned_de_data <- clean_disease_expose(data = de_data, disease = "disease", noDisease = "No", exposures = c("exposure1", "exposure2", "exposure3")) # clean the data using specific columns in the dataset cleaned2 <- clean_disease_expose(data = de_data, disease = "disease", noDisease = "No", exposures = c(3,4,5)) # clean the data again, but use the number of each exposure column instead cleaned3 <- clean_disease_expose(data = de_data, disease = 2, exposures = c("exposure1", "exposure2", "exposure3")) # clean the data, but use the number of the disease column instead of the name and don't give a noDisease value
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.