I need to generate poisson distribution of different lambda contained in a vector(length of 50), use the result as a new vector of lambda and then do it for 10 times repeatedly. I know I can do it with for
but it seems lousy. Is there any good techs?
BTW: rpois(50, seq(1,10))
seems not working.
Use:
library(plyr)
list_poisson <- lapply(seq(1:10), FUN = function(x, y) rpois(y, x), y = 50)
To generate a list of poisson distributions with different lambda
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments