Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rdensity

Distribution methods for density objects


Description

Density, distribution function, quantile function and random generation from a kernel density estimate (using linear approximation).

Usage

ddensity(x, d)

pdensity(q, d)

qdensity(p, d)

rdensity(n, d)

Arguments

x

a vector

d

a density object

q

a vector

p

a vector of probabilities

n

number of observations. If length(n) > 1, the length is taken to be the number of required

Author(s)

user295691, Neal Fultz

References

See Also

Examples

x <- rnorm(100, mean=0:5)
d <- density(x)
r <- rdensity(10000, d)
plot(d)
lines(density(r), new=TRUE, col='blue', lty='dashed')

stackoverflow

Stack Overflow's Greatest Hits

v0.7.0
CC BY-SA 4.0
Authors
Neal Fultz <nfultz@gmail.com> and the StackOverflow.com community
Initial release
2020-01-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.