R Quiz - Module 1

Which of the following statements about variables is true?
The only way to assign a variable name is with <- arrow syntax.
Once a variable has been created, you cannot change its value.
Variable names can start with letters, numbers, and a period or underscore character.
Variables store information in your program and associate that information with a name.
Which of the following is a false statement about vectors?
Vectors are list-like data-structures.
Vectors are created by calling the c() function and passing in arguments to add to the vector.
Vectors can store items of different data types.
You can retrieve the length of a vector by calling the length() function and passing in the vector as an argument.
Which of the following defined variables has a logical value?
Cool_variable1 <- 324.2
Cool_variable2 <- "Hola, mucho gusto."
Cool_variable3 <- FALSE
Cool_variable4 <- 0
Which of the following examples includes a function call with two arguments?
Population <- '7 billion'
Numbers <- c(22,33,44,55)
Length(data)
Sum(289,398)
Which of the following creates a variable with arrow syntax called student_count with a character value of 23?
Student_count <- 23
Student_count = '23'
Student_count <- '23'
Student_count = 23
What is the outcome of the following code snippet? (15 + 5) * 2 - 2
23
0
38
2
Which of the following sentences explains the conditional statement below?
 

if (age >= 18 & registered == TRUE) {

  can_vote <- TRUE

} else {

  can_vote <- FALSE

}

If age is greater than or equal to 18 and registered is TRUE, set the value of can_vote to TRUE. Otherwise, set it to FALSE.
If age is greater than or equal to 18 and registered is TRUE, set the value of can_vote to FALSE. Otherwise, set it to TRUE.
If age is greater than 18 and registered is TRUE, set the value of can_vote to TRUE. Otherwise, set it to FALSE.
If age is greater than 18 or registered is TRUE, set the value of can_vote to TRUE. Otherwise, set it to FALSE.
Which of the following is an example of a single line comment?
/* This is a comment */
This is a comment.
# This is a comment
// This is a comment.
{"name":"R Quiz - Module 1", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Which of the following statements about variables is true?, Which of the following is a false statement about vectors?, Which of the following defined variables has a logical value?","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
Make your own Survey
- it's free to start.