clip_fun {fsbrain} | R Documentation |
Get data clipping function.
Description
Get data clipping function to use in rglactions
as 'trans_fun' to transform data. This is typically used to limit the colorbar in a plot to a certain range. This uses percentiles to clip. Clipping means that values more extreme than the gĂven quantiles will be set to the quantile values.
Usage
clip_fun(lower = 0.05, upper = 0.95)
Arguments
lower |
numeric. The probability for the lower quantile, defaults to '0.05'. |
upper |
numeric. The probability for the upper quantile, defaults to '0.95'. |
Value
a function that takes as argument the data, and clips it to the requested range. I.e., values outside the range will be set to the closest border value. Designed to be used as rglactions$trans_fun
in vis functions, to limit the colorbar and data range.
See Also
Examples
rglactions = list("trans_fun"=clip_fun(0.10, 0.90));
rglactions = list("trans_fun"=clip_fun());
f = clip_fun();
f(rnorm(100));
[Package fsbrain version 0.5.5 Index]