Bonjour,
Quand je fais tourner ce code, je n'obtiens pas une courbe.
Merci de corriger si c'est possible.
Merci d'avance


set.seed(100)
lambda=2
x=seq(1,100,1)
dfctpoisson<- function(x,lambda,log = FALSE){
if (any(x<0)) { print(" x is smaller than zero. Check the data")}
else
{
prob <-dpois(x,lambda,log = FALSE)
#prob <-exp(-lambda)*((lambda^x)/factorial(x))
return (prob)
}
}

curve(dfctpoisson(x,lambda,log =FALSE),x)