shrink_df | R Documentation |
Shrink data.frame by row groups
shrink_df(
x,
by,
string_func = function(x) jamba::cPasteSU(x, na.rm = TRUE),
num_func = function(x) mean(x, na.rm = TRUE),
add_string_cols = NULL,
num_to_string_func = as.character,
keep_na_groups = TRUE,
include_num_reps = FALSE,
extra_funcs = NULL,
do_test = FALSE,
use_new_method = FALSE,
verbose = FALSE,
...
)
by |
|
string_func |
|
num_func |
|
extra_funcs |
|
do_test |
|
use_new_method |
|
verbose |
|
... |
additional arguments are ignored. |
df |
|
This function is currently a wrapper for shrinkDataFrame()
,
it was formerly 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:
choose_annotation_colnames()
,
contrast2comp_dev()
,
fold_to_log2fold()
,
intercalate()
,
list2im_opt()
,
log2fold_to_fold()
,
make_block_arrow_polygon()
,
mark_stat_hits()
,
matrix_normalize()
,
point_handedness()
,
point_slope_intercept()
,
shortest_unique_abbreviation()
,
shrinkDataFrame()
,
shrink_matrix()
,
sort_samples()
,
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.