Page 244 - Data Science class 11
P. 244
10. Which function can be used to return the square root of a number?
a. sqrt() b. square_root()
c. sqroot() d. sr()
11. What is the correct way to create a vector of strings?
a. fruits <- c(“banana”, “apple”, “orange”)
b. fruits <- v(“banana”, “apple”, “orange”)
c. fruits <- list(“banana”, “apple”, “orange”)
d. fruits <- listOf(“banana”, “apple”, “orange”)
12. What is the correct way to create a list of strings?
a. fruits <- c(“banana”, “apple”, “orange”)
b. fruits <- vectorOf(“banana”, “apple”, “orange”)
c. fruits <- list(“banana”, “apple”, “orange”)
d. fruits <- v(“banana”, “apple”, “orange”)
13. Which function can be used to create a data frame?
a. dataframe() b. df()
c. dframe() d. data.frame()
14. Which function is used to add additional columns to a matrix?
a. append_item() b. cbind()
c. add() d. join()
15. How do you start writing an if statement in R?
a. if (x > y) b. if x > y:
c. if x > y then: d. None of these
16. Which function is used to find the number of rows and columns in an array?
a. dim_len() b. dim()
c. length() d. nchar()
B. Fill in the blanks.
1. The structure of the data frame can be seen using the ______________________ function.
2. The ______________________ function is used to calculate the sum of the elements in the rows of an array across all the
matrices.
3. ______________________ are the R data objects in which we can store data in more than two dimensions.
4. The ______________________ parameter when set to TRUE in a matrix, the elements in the input vector are organised by
row.
5. When ______________________ indexing is used, the elements of the vector are ignored.
C. State whether these statements are true or false.
1. List is a type of R object that contains different types of elements like-numbers, vectors, strings,
and another list within it. ____________
242 Touchpad Data Science-XI

