Description Usage Arguments Details Value See Also Examples

`linear.scale()`

linearly 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.

1 | ```
linear.scale(x, min, max)
``` |

`x` |
A numeric vector or matrix |

`min` |
The desired minimum value, a |

`max` |
The desired maximum value, a |

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`

,
linearly rescaled in the desired way.

1 2 3 4 5 | ```
x <- 1:10
linear.scale(x, min=-2, max=-1.5)
## If max<min, it's rescaled in reverse:
linear.scale(x, min=10, max=1)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.