binarize_binom: binarize_binom

Description Usage Arguments Value Author(s) See Also Examples

Description

Transform a data with binomial responses into a data with binary response.

Usage

1
binarize_binom(dat, responses, variable.name = NULL)

Arguments

dat

A data whose features are categorical, and has two integer columns that correspond to binomial responses

responses

A character vector of length 2 where each element is the names of columns that store the counts of positive and negative responses, in this order

variable.name

NULL by default; a character that will be used for the name of new binary response column after binarization; if NULL, then a randomly generated character will be used

Value

A data.table that has the same categorical features as dat, and has variable.name column as its binary response

Author(s)

Junkyu Park

See Also

binarize_pois, change_form, Binarizing data using data.table

Examples

1
2
3
# data(rich_binom)
binarize_binom(rich_binom, c('rich', 'not_rich'))
binarize_binom(rich_binom, c('rich', 'not_rich'), 'is_rich')

joon3216/funpark documentation built on June 18, 2019, 7:32 a.m.