Data Types and Variables in R
Data Types and Variables in R - Important Points
6. | Which of the following data types is used to represent a two-dimensional table in R? |
---|
A. Vector
B. List
C. Data frame
D. Matrix
View Answer Discuss Work SpaceAnswer: option c
Explanation:
7. | Which of the following is a valid way to create a vector in R? |
---|
A. vec <- 1 2 3
B. vec <- c(1, 2, 3)
C. vec <- c(1 2 3)
D. vec <- [1, 2, 3]
View Answer Discuss Work SpaceAnswer: option b
Explanation:
8. | Which of the following is a valid way to create a list in R? |
---|
A. list <- c(1, "a", TRUE)
B. list <- list(1, "a", TRUE)
C. list <- [1, "a", TRUE]
D. list <- {1, "a", TRUE}
View Answer Discuss Work SpaceAnswer: option b
Explanation:
9. | Which of the following is a valid way to create a data frame in R? |
---|
A. df <- data.frame(1, 2, 3)
B. df <- data.frame(c(1, 2, 3))
C. df <- data.frame(x = c(1, 2, 3), y = c("a", "b", "c"))
D. df <- data.frame(list(1, "a", TRUE))
View Answer Discuss Work SpaceAnswer: option c
Explanation:
10. | Which of the following data types is used to represent missing or undefined values in R? |
---|
A. NA
B. NaN
C. Inf
D. #NAME?
View Answer Discuss Work SpaceAnswer: option a
Explanation: