# R Programming Questions and Answers – dplyr – 2

This set of R Programming Test focuses on “dplyr Basics”.

1. The _________ function can be used to select columns of a data frame that you want to focus on.
a) select
b) rename
c) get
d) set

Explanation: The select() function allows you to get the few columns you might need.

2. Point out the correct statement?
a) You can also omit variables using the select() function by using the negative sign
b) The arrange() function also allows a special syntax that allows you to specify variable names based on patterns
c) Reordering rows of a data frame is normally easier to do in R
d) The dplyr package provides any “new” functionality to R

Explanation: The arrange() function is used to reorder rows of a data frame according to one of the variables/columns.

3. ________ function is similar to the existing subset() function in R but is quite a bit faster.
a) rename
b) filter
c) set
d) subset

Explanation: The filter() function is used to extract subsets of rows from a data frame.

4. Columns can be arranged in descending order too by using the special ____ operator.
a) asc()
b) desc()
c) descending()
d) subset

Explanation: This will sort the order in decreasing order.

5. Point out the wrong statement?
a) Renaming a variable in a data frame in R is surprisingly hard to do
b) The mutate() function exists to compute transformations of variables in a data frame
c) mute() function, which does the same thing as mutate() but then drops all non-transformed variables
d) The data frame is a key data structure in statistics and in R

Explanation: The rename() function is designed to make this process easier.

6. The _________ function is used to generate summary statistics from the data frame within strata defined by a variable.
a) groupby()
b) group()
c) group_by()
d) arrange

Explanation: The general operation here is a combination of splitting a data frame into separate pieces defined by a variable or group of variables (group_by()), and then applying a summary function across those subsets (summarize()).

7. The ______ operator allows you to string operations in a left-to-right fashion.
a) %>%>
b) %>%
c) >%>%
d) >>>>%%%

Explanation: The pipeline operator %>% is very handy for stringing together multiple dplyr functions in a sequence of operations.

8. There is an SQL interface for relational databases via the _______ package.
a) DIB
b) DB2
c) DBI
d) DIB21

Explanation: dplyr can work with other data frame “backends” such as SQL databases.

9. dplyr can be integrated with the ________ package for large fast tables.
a) data.table
c) data.data

Explanation: The dplyr package is handy way to both simplify and speed up your data frame management code.

10. Which of the following function is similar to summarize?
a) arrange_by()
b) group()
c) group_by()
d) arrange

Explanation: The dplyr package provides a concise set of operations for managing data frames.

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 for various tests, 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]