-1

Generate a vector of 1000 Poisson random numbers with λ = 3. Make a histogram and a boxplot of the 1000 numbers. Find the expected value of the vector in Rstudio

Phil
  • 7,287
  • 3
  • 36
  • 66
  • 1
    Welcome to SO! Just for information, SO is not meant to make your homework for you. Instead, we can answer specific programming-related questions. – nicola Jan 20 '21 at 13:15
  • thank you sir for your comment. but first of all, this is not my homework. Randomly I am working on R programming and I have a problem finding expected value. Now I know that why we use set.seed() because I am new in R programming. So I was just getting help from others. that's it. Again this is not my homework. – Shehryar Khan Jan 21 '21 at 01:09

1 Answers1

0

Try with this:

set.seed(123)
#Code
v <- rpois(1000,lambda = 3)
#Hist
hist(v)
#Boxplot
boxplot(v)
#Mean
mean(v)
Duck
  • 39,058
  • 13
  • 42
  • 84