shrink_df | R Documentation |
Mock-up shrink data.frame function
shrink_df(
df,
by,
string_func = jamba::cPasteU,
num_func = mean,
extra_funcs = NULL,
do_test = FALSE,
verbose = FALSE,
...
)
df |
|
by |
|
string_func |
|
num_func |
|
extra_funcs |
|
do_test |
|
verbose |
|
... |
additional arguments are ignored. |
This function is a simplified version of shrinkDataFrame()
which is intended to use more modern methods from the R package
data.table
.
The general idea is to collapse numeric
columns using num_func
,
and collapse character
and all other columns using string_func
.
Any exceptions, where a different function should be applied, are
passed via argument extra_funcs
which is a list
of functions
named by values in colnames(df)
.
Other jamses utilities:
fold_to_log2fold()
,
log2fold_to_fold()
,
mark_stat_hits()
,
se_collapse_by_column()
,
se_collapse_by_row()
,
se_rbind()
,
shrinkDataFrame()
,
strsplitOrdered()
,
sub_split_vector()
,
update_function_params()
,
update_list_elements()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.