Skip to content

Instantly share code, notes, and snippets.

@cagdasyetkin
Forked from earino/quiz1.txt
Last active February 18, 2018 21:59
Show Gist options
  • Save cagdasyetkin/20fd11664b4ce7e69caf5194f480723a to your computer and use it in GitHub Desktop.
Save cagdasyetkin/20fd11664b4ce7e69caf5194f480723a to your computer and use it in GitHub Desktop.
Dplyr Questions
1. Which of the following return a subset of the columns of a data frame ?
a) select (X)
b) retrieve
c) get
d) all of the mentioned
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 (X)
3. _________ extract a subset of rows from a data frame based on logical conditions.
a) rename
b) filter (X)
c) set
d) subset
4. _________ generate summary statistics of different variables in the data frame, possibly within strata
a) rename
b) summarize (X)
c) set
d) subset
5. Point out the wrong statement :
a) The dplyr package was developed by Hadley Wickham of RStudio
b) The dplyr packageis an optimized and distilled version of his plyr package
c) The dplyr package provides “new” functionality to R (X)
d) None of the mentioned
6. ________ add new variables/columns or transform existing variables
a) mutate (X)
b) add
c) apped
d) arrange
7. The _______ operator is used to connect multiple verb actions together into a pipeline
a) pipe (X)
b) piper
c) start
d) all of the mentioned
Strings and Regexps
8. Which metacharacter matches the end of a string?
A. $ (X)
B. ^
C. |
9. What does this expression match?
^[abcd]
A. Any string with an a, b, c, or d in it
B. Any string that begins with a, b, c, or d
C. Any string that begins with a lowercase a, b, c, or d (X)
10. 8. Which of the following regular expressions will match this string:
AaZzXzY
A. x
B. ^[a-z]*$ (X)
C. ^\w*$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment