powered by
Internal soundgen function.
pDistr(x, quantiles)
numeric vector of non-negative real numbers
quantiles of the cumulative distribution
Calculates the values in the input distribution that contain particular proportions of the sum of all values in the input distribution.
# NOT RUN { x = rnorm(100) x = x - min(x) # must be non-negative hist(x) v = soundgen:::pDistr(x, quantiles = c(.5, .8, .9)) sum(x[x > v['0.5']]) / sum(x) sum(x[x > v['0.9']]) / sum(x) # }
Run the code above in your browser using DataLab