redf {activity} | R Documentation |
Random numbers drawn from an empirical distribution defined by paired values and probabilities.
redf(n, fit)
n |
Integer number of random numbers to return. |
fit |
Data frame defining the emprical distribution (see details). |
The distribution function is defined by fit
, which must be a dataframe containing (at least) columns named:
x: a regular sequence of values from which to draw;
y: corresponding pdf values.
A numeric vector.
data(BCItime)
tm <- 2*pi*subset(BCItime, species=="paca")$time
mod <- fitact(tm)
rn <- redf(1000, as.data.frame(mod@pdf))