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: dpois.maxtrunc

Function Description: dpois.maxtrunc

A zero-truncated Poisson distribution with a ceiling (combining dpois.max and dpois.trunc).

Function Arguments:

ArgumentDefault Value
x
lambda
maxx
logFALSE

Function Source:

dpois.maxtrunc=function(x,lambda,maxx,log=FALSE)
{
result=dpois.max(x,lambda=lambda,maxx=maxx)/(1-exp(-lambda))
zero=x==0
result[zero]=0

if(log) return(log(result))
else return(result)
}