View source: R/transforms_fill.R
exclusion_codes | R Documentation |
Create an exclusion column
exclusion_codes(.data, .col, ..., method = "first", default = "OK")
.data |
A data_frame type object |
.col |
The unquoted name of the column to create |
... |
Name-value pairs of conditions to use in creating codes |
method |
one of "first" or "last", determining which code to use in case multiple conditions are true |
default |
The value to use if no conditions are true. Defaults to "OK". |
the modified .data data_frame
library(dplyr)
data_frame(ID=1:3,SEX=c("M","F","X")) %>%exclusion_codes(EXCL, BADSEX=SEX=="X", remove.subject=ID==3)
data_frame(ID=1:3,SEX=c("M","F","X")) %>%exclusion_codes(EXCL, BADSEX=SEX=="X", remove.subject=ID==2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.