Which Of The Following R Code Generate A Uniform Random Number #336
Which of the following R code generate a uniform random number?
This multiple choice question (MCQ) is related to the book/course gs gs110 R Language. It can also be found in gs gs110 Control Structures, Functions, Scoping Rules, Loop Functions and Debugging - Control Structures - Quiz No.1.
Which of the following R code generate a uniform random number?
x <- runif(1, 0, 10) if(x > 3) { y <- 10 } else { y <- 0 }
x <- run(1, 0, 10) if(x > 3) { y <- 10 } else { y <- 0 }
x <- random(1, 0, 10) if(x > 3) { y <- 10 } else { y <- 0 }
x <- random(1, 0, 10) if(x > 1) { y <- 0 } else { x <- 0 }