Error in pbinom(n = 1, size = Rt_sto[t], prob = a2) : unused argument (n = 1)


#1

can anybody help with the below? I am getting an unused argument error for n=1 and I am perplexed. I m a new r user and would welcome some help. many thanks

a2 <- 0.05
b2 <- 0.0001
y2 <- 0.02
weeks <- 104
Rt_sto <- 30
Ft_sto <- 40



```{r}
for (t in 1:(weeks-1)) {
  
  
set.seed(60854)
  
  EQ1 <- pbinom(n = 1, size = Rt_sto[t], prob = a2)
  EQ2 <- pbinom(n = 1, size = Rt_sto*Ft_sto, prob = b2)
  EQ3 <- pbinom(n = 1, size = Ft_sto, prob = y2)

#2

Typing

?pbinom

Yields

pbinom(q, size, prob, lower.tail = TRUE, log.p = FALSE)

#3

Hi Leon

i fixed it , problem was between keyboard and mouse (me) ... it was rbinom that i was attempting to do through pbinom.

thanks for the reply though. much appreciated.