exp_scale | R Documentation |
exp_scale()
exponentially transforms its input
vector x
so that its minimum value is min
and its maximum value is max
. This is for use as a
scaling function in sonscaling
. It is
unlikely to be directly called by the user.
exp_scale(x, limits = NULL, soundlimits, by = NULL)
x |
A numeric vector or matrix |
limits |
The limits of the data to train, a numeric
vector of length 2. All data values outside these limits
are returned as |
soundlimits |
The limits of the sound parameter. |
by |
The unit to round the sound parameter to. See examples. |
This simple function does the important work of actually
rescaling the given data of a sonify
object into
the range of the given sonic parameter, which is why it's
included in playitbyr. But it can be used on any
vector or matrix.
A numeric vector or matrix of the same type as x
,
exponentially rescaled in the desired way.
linear_scale
for more details on how
scaling functions work
x <- 1:10
exp_scale(x, soundlimits = c(-2, -1.5))
## If max<min, it's rescaled in reverse:
exp_scale(x, soundlimits = c(10, 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.