redf {activity}R Documentation

Random numbers from empirical distribution function.

Description

Random numbers drawn from an empirical distribution defined by paired values and probabilities.

Usage

redf(n, fit)

Arguments

n

Integer number of random numbers to return.

fit

Data frame defining the emprical distribution (see details).

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.

Value

A numeric vector.

Examples

data(BCItime)
tm <- 2*pi*subset(BCItime, species=="paca")$time
mod <- fitact(tm)
rn <- redf(1000, as.data.frame(mod@pdf))

[Package activity version 1.3.4 Index]