[R] Generic distributions

Alberto Monteiro albmont at centroin.com.br
Wed Mar 7 12:32:25 CET 2007


Matthias Kohl wrote:
> 
> in distr you can do:
> 
> library(distr)
> N <- Norm(mean = 1, sd = 2)
> p(N)(0.5)
> r(N)(100)
> 
> !!! not: p(N, 0.5) or r(N, 100) !!!
> A detailed description of package "distr" is given in package "distrDoc".
> 
> library(distrDoc)
> vignette("distr")
> 
Thanks!!! This is almost perfect. It even has (some) arithmetics!!!

z1 <- Norm(mean = 1, sd= 0.6)
z2 <- Norm(mean = 2, sd= 0.8)
z1+z2

Distribution Object of Class: Norm
mean :  3 
sd :  1 
Warning message:
arithmetics on distributions are understood as operations on r.v.'s
see 'distrARITH()'; for switching off this warning see '?distroptions' in: 
print(object) 
 
Alberto Monteiro



More information about the R-help mailing list