Skip to content
Prev 1178 / 7420 Next

Probability distributions

Hi Lene,

See ?curve or ?lines.

Also, plot.function calls curve so the following works:

plot(function(x) dweibull(x, .5, 1), 0, 5, col = 1, ylab = 'density',
     main = 'Weibull densities')
plot(function(x) dweibull(x, 2, 1), 0, 5, col = 2, add = TRUE)
plot(function(x) dweibull(x, .5, .5), 0, 5, col = 3, add = TRUE)
plot(function(x) dweibull(x, 2, .5), 0, 5, col = 4, add = TRUE)
legend('topright', paste('shape =' , c('0.5' ,'2.0', '0.5', '2.0'),
       '   scale =', c('1.0', '1.0', '0.5', '0.5')), lty = 1, col = 1:4)


hth,

Kingsford Jones
On Fri, Apr 9, 2010 at 9:40 AM, Lene Jung Kjaer <jung at siu.edu> wrote: