View source: R/statistical_simulation.r
get_transform_names | R Documentation |
The function simbase_covar
allows the specification of a
transform for one or more variables. The present function creates short
names for such transforms for use in labelling (by default, the labelling is
done by simbase_labeler
).
get_transform_names( transforms, prefer_primitive = c("if_shorter", "never", "always") )
transforms |
A named list of objects of class |
prefer_primitive |
If "never", the function always returns the value of
the field |
The label of a transform could be the value of the field name
from
each object of class trans
, but also the name of the transform
function itself, if it is a primitive function or just calls one function.
Each object of class trans
should have a field name
which can be returned by the present function.
The function examines the field transform
.
If this field contains a primitive function (see is_primitive
),
or if there is just one function call in the body of this transform
function, we can also return the name of this called function.
If there is no field name
and no single function is called from the
function defined in the field transform
,
a generic function name "f."
is returned.
A named vector of transforms names.
get_transform_names(list(a = scales::log_trans(), b = scales::boxcox_trans(0))); get_transform_names(list(x = list(name = 'a very long name', transform = log, inverse = exp)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.