rdata(n, vals, replace = TRUE, data=NULL, ...)
pdata(q, vals, lower.tail=TRUE,data=NULL, ...)
qdata(p, vals, data=NULL, ...)
ddata(x, vals, log=FALSE, data=NULL, ...)
data=
style of referring to variables in data frames.ddata
gives the (log) density, pdata
gives the distribution function,
qdata
gives the quantile function, and rdata
generates random deviates
treating vals
as an enumeration of the population.
For rdata
, the sampling can be either with or without replacement.data(iris)
rdata(10,iris$Species)
rdata(10, Species, data=iris)
ddata('setosa',iris$Species)
ddata('setosa', Species, data=iris)
pdata(3:6, iris$Sepal.Length)
pdata(3:6, Sepal.Length, data=iris)
qdata(.5, iris$Sepal.Length)
qdata(.5, Sepal.Length, data=iris)
Run the code above in your browser using DataLab