scaleto: Scales data within a range to a new range
Description
This function scales data to a new range while enforcing the boundaries. This
can be helpful in preventing overlap between chromosomal plots that display
multiple chromosomes in the same plot
Usage
scaleto(x, fromlimits = c(0, 50), tolimits = c(0.5, -0.5), adjust = TRUE)
Arguments
fromlimits
numeric vector with length 2, original range of data
tolimits
numeric vector with length 2, target range of data
adjust
logical, if TRUE
then the target values are clipped to
the target range
Value
numeric of same size as x