resc.val | R Documentation |
The function allows to rescale the values of a dataset between a minimum and a maximum that are specified by the user. In doing that, it allows to preserve the shape of the distribution of the original data.
resc.val(x, min.v = 0, max.v = 100)
x |
Vector containing the values to be rescaled. |
min.v |
Minimum value of the rescaled dataset (0 by default). |
max.v |
Maximum value of the rescaled dataset (100 by default). |
The function produces two density charts representing the distribution of the original and of the rescaled dataset. It also returns a dataframe storing the original and rescaled values.
#generate a random dataset of size 30, normally distributed with mean 1000 and #standard deviation 10 dataset <- rnorm(30, 1000,10) #rescale the dataset to be constrained between 10 and 100 resc.val(dataset, min.v=10, max.v=100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.