rpois function

This function generates a list of random variables that follow a Poisson distribution with a certain average rate of success, In other words, we can say as this function generates a vector of Poisson distributed random variables.

Syntax: rpois(n, lambda)

Parameters:

  • n: number of random variables to generate
  • lambda: average rate of success

Example:

In this example, we are generating a list of 20 random variables that follow a Poisson distribution with a rate of success equal to 6.

R




rpois(n=15, lambda=6)


Output:

 [1] 5 9 4 7 7 9 6 8 4 3 9 3 2 2 9


A Guide to dpois, ppois, qpois, and rpois in R

In this article, we will be looking at a guide to the dpois, ppois, qpois, and rpois methods of the Poisson distribution in the R programming language.

Similar Reads

dpois function

This function finds the probability that a certain number of successes occur based on an average rate of success, In other words, we can say as this function returns the value of the Poisson probability density function...

ppois function

...

qpois function

This function finds the probability that a certain number of successes or less occur based on an average rate of success, In other words, we can say as this function returns the value of the inverse Poisson cumulative density function....

rpois function

...