Description Usage Arguments Value Author(s) See Also Examples
Transform a data from one form into another.
1 2 | change_form(dat, from, to,
old_response, category, new_response)
|
dat |
A data whose features are categorical and response(s) is/are nonnegative integer vector(s). |
from |
A character; either 'binary', 'binomial', or 'poisson' |
to |
A character != from; either 'binary', 'binomial', or 'poisson' |
old_response |
(always specified) a character vector of:
|
category |
(specified if either to = 'poisson' or (from, to) = ('poisson', 'binomial')) a character vector of:
|
new_response |
(specified only if from != 'poisson') a character vector of:
|
A data.table that has transformed from the form specified in
from
to the form specified in to
.
Junkyu Park
binarize_binom
,
binarize_pois
,
Binarizing data using data.table
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | change_form(
rich,
from = 'binary', to = 'binomial',
old_response = 'is_rich',
new_response = c('rich', 'not_rich')
)
change_form(
rich,
from = 'binary', to = 'poisson',
old_response = 'is_rich',
category = c('rich', 'not_rich'),
new_response = 'count'
)
change_form(
rich_binom,
from = 'binomial', to = 'binary',
old_response = c('rich', 'not_rich'),
new_response = 'is_rich'
)
change_form(
rich_binom,
from = 'binomial', to = 'poisson',
old_response = c('rich', 'not_rich'),
category = 'is_rich',
new_response = 'count'
)
change_form(
rich_pois,
from = 'poisson', to = 'binary',
old_response = 'count'
)
change_form(
rich_pois,
from = 'poisson', to = 'binomial',
old_response = 'count',
category = 'is_rich'
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.