Topic: Utilities

Topic Description:

Basic R utilities used in many packages and functions, such as date and string manipulations, statistical distributions, geometry of lines and distances. The R package date is required for the two data functions.



File: utilities/distributions.r

View File Source Download File No help file available

Function: rpois.trunc

Function Description: rpois.trunc

Random draws on dpois.trunc. This is taken unchanged from an answer Peter Dalgaard posted to a list serve in 2005. I checked by comparing to dpois.trunc and it was spot on.

Function Arguments:

ArgumentDefault Value
N
lambda

Function Source:

rpois.trunc=function(N,lambda)
{
return(qpois(runif(N, dpois(0, lambda), 1), lambda))
}