exclusion_codes: Create an exclusion column

View source: R/transforms_fill.R

exclusion_codesR Documentation

Create an exclusion column

Description

Create an exclusion column

Usage

exclusion_codes(.data, .col, ..., method = "first", default = "OK")

Arguments

.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".

Value

the modified .data data_frame

Examples

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)

qPharmetra/PMDatR documentation built on April 7, 2024, 5:42 p.m.