For a given table in a taxmap object, run some function to produce new columns. This function handles all of the option parsing and formatting of the result.
do_calc_on_num_cols(obj, dataset, func, cols = NULL, other_cols = FALSE,
out_names = NULL)
A taxmap object
The name of a table in obj
.
The function to apply. Should accept and return a table.
The names/indexes of columns in dataset
to use. By
default, all numeric columns are used. Takes one of the following inputs:
All/No columns will used.
The names of columns to use
The indexes of columns to use
Use the columns
corresponding to TRUE
values.
Preserve in the output non-target columns present in the input data. New columns will always be on the end. The "taxon_id" column will always be preserved in the front. Takes one of the following inputs:
All non-target columns will be preserved or not.
The names of columns to preserve
The indexes of columns to preserve
Preserve the columns
corresponding to TRUE
values.
If supplied, rename the output proportion columns. Must be
the same length as cold
.
A tibble