R Programming Questions and Answers – dplyr – 1

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

Answer: a
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

Answer: d
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

Answer: a
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

Answer: b
Explanation: The dplyr package as a number of its own data types that it takes advantage of.

advertisement
advertisement

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

Answer: c
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

Answer: a
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

Answer: a
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

Answer: b
Explanation: The GitHub repository will usually contain the latest updates to the package and the development version.

advertisement

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

Answer: b
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

Answer: a
Explanation: The following objects are masked from ‘package:base’: intersect, setdiff, setequal, union.

advertisement

Sanfoundry Global Education & Learning Series – R Programming Language.

Here’s the list of Best Books in R Programming Language.

To practice all areas of R Programming Language, Here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.