Description Usage Arguments Value Examples
dichot will take a variable and dichotomize it into 0, 1 (and NA for any unspecified levels)
1 | dichot(x, group1, group2)
|
x |
input data |
group1 |
vector of levels to be set to 0 |
group2 |
vector of levels to be set to 1 |
output vector of 0, 1, NA
1 2 | #fakeData <- data.frame(x = sample(c(1, 2, 3, 4, 5), 20, replace = T))
#dichot(x = fakeData$x, group1 = c(1, 2), group2 = c(3, 4))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.