This set of R Programming Language Multiple Choice Questions & Answers (MCQs) focuses on “dplyr – 1”.
1. Which of the following return a subset of the columns of a data frame?
a) select
b) retrieve
c) get
d) set
View Answer
Explanation: One important contribution of the dplyr package is that it provides a “grammar” for data manipulation and for operating on data frames.
2. Point out the correct statement?
a) The data frame is a key data structure in statistics and in R
b) R has an internal implementation of data frames that is likely the one you will use most often
c) There are packages on CRAN that implement data frames via things like relational databases that allow you to operate on very very large data frames
d) All of the mentioned
View Answer
Explanation: The basic structure of a data frame is that there is one observation per row and each column represents a variable, a measure, feature, or characteristic of that observation.
3. _________ extract a subset of rows from a dataframe based on logical conditions.
a) rename
b) filter
c) set
d) subset
View Answer
Explanation: rename is used to rename variables in a dataframe.
4. _________ generate summary statistics of different variables in the data frame, possibly within strata.
a) rename
b) summarize
c) set
d) subset
View Answer
Explanation: The dplyr package as a number of its own data types that it takes advantage of.
5. Point out the wrong statement?
a) The dplyr package was developed by Hadley Wickham of RStudio
b) The dplyr package is an optimized and distilled version of his plyr package
c) The dplyr package provides any “new” functionality to R
d) The dplyr package does not provide any “new” functionality to R
View Answer
Explanation: The dplyr package does not provide any “new” functionality to R.
6. ________ add new variables/columns or transform existing variables.
a) mutate
b) add
c) apped
d) arrange
View Answer
Explanation: arrange is used to reorder rows of a dataframe.
7. The _______ operator is used to connect multiple verb actions together into a pipeline.
a) pipe
b) piper
c) start
d) end
View Answer
Explanation: It is denoted by %>% sign.
8. The dplyr package can be installed from GitHub using the _______ package.
a) dev
b) devtools
c) devtool
d) devdel
View Answer
Explanation: The GitHub repository will usually contain the latest updates to the package and the development version.
9. The dplyr package can be installed from CRAN using __________
a) installall.packages(“dplyr”)
b) install.packages(“dplyr”)
c) installed.packages(“dplyr”)
d) installed.packages(“dpl”)
View Answer
Explanation: After installing the package it is important that you load it into your R session with the library() function.
10. Which of the following object is masked from ‘package: stats’?
a) filter
b) union
c) set difference
d) get difference
View Answer
Explanation: The following objects are masked from ‘package:base’: intersect, setdiff, setequal, union.
Sanfoundry Global Education & Learning Series – R Programming Language.
Here’s the list of Best Books in R Programming Language.
- Check Information Technology Books
- Check R Programming Books
- Apply for Programming Internship
- Practice Programming MCQs