Q. Which of the following R code generate a uniform random number?

  • (A) x <- runif(1, 0, 10) if(x > 3) { y <- 10 } else { y <- 0 }
  • (B) x <- run(1, 0, 10) if(x > 3) { y <- 10 } else { y <- 0 }
  • (C) x <- random(1, 0, 10) if(x > 3) { y <- 10 } else { y <- 0 }
  • (D) x <- random(1, 0, 10) if(x > 1) { y <- 0 } else { x <- 0 }
πŸ’¬ Discuss
βœ… Correct Answer: (A) x <- runif(1, 0, 10) if(x > 3) { y <- 10 } else { y <- 0 }

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
114
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
95%
Success Rate