I have the function
We are told to do set.seed(100) and we know lambda=10
set.seed(100)
lambda<-10
F<-function(lambda,k) {
X<-NULL
X= exp(-lambda) * sum((lambda ^ seq(0 , k)) / factorial(seq(0 , k)))
return(X)
I then had to find F when k=3 so I did
F3<-F(10,3)
F3
I also tried
k<-3
lambda<-10
F3<-F(lambda,k)
F3
when I run either of those codes I get
Warning message:
In if (n <= 1) { :
the condition has length > 1 and only the first element will be used
can anyone help solve why this is happening??