gs gs110 Control Structures, Functions, Scoping Rules, Loop Functions and Debugging - Control Structures - Quiz No.1
gs gs110 R Language Quiz
This quiz belongs to book/course code gs gs110 R Language of gs organization. We have 87 quizzes available related to the book/course R Language. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic Control Structures, Functions, Scoping Rules, Loop Functions and. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.
NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.
if(<condition>) { ## do something } else { ## do something else }
if(<condition>) { ## do something } elseif { ## do something else }
if(<condition>) { ## do something } else if { ## do something else }
if(<condition>) { ##& do something } else { ##@ do something else }
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 }
> for(i in 1:9) { + print(i) + } [1]
> for(i in 0:9) { + print(i) + } [1]
> for(i in 1:10) { + print(i) + } [1]
> for(i in 2:50) { + print("i") + } [1]
> x <- c("a", "b", "c", "d") > for(i in 1:4) { + ## Print out each element of 'x' + print(x[i]) + }
[1] "a" [1] "b" [1] "c" [1] "d"
[1] "c" [1] "b" [1] "a" [1] "d"
[1] "d" [1] "c" [1] "b" [1] "a"