R Programming Language Multiple Choice Questions on “Data Wrangling”.
1. _________ is new package that makes it easy to “tidy” your data.
a) tidy
b) tidyr
c) tidyneat
d) tidynr
Answer: c
Clarification: Tidy data is data that’s easy to work in R.
2. Point out the correct statement?
a) Each row is an observation in tidy data
b) Each column is a variable in tidy data
c) Arranging your data in tidy way makes it easier to work
d) All of the mentioned
Answer: d
Clarification: When use tidy data and tidy tools, you spend less time worrying about how to feed the output from one function into the input of another.
3. Which of the following is complementary to tidyr?
a) geolr
b) dplyr
c) d3lr
d) gekl2
Answer: b
Clarification: Its easy to munge with dplyr.
4. How many functions exist for tidying the data?
a) one
b) two
c) three
d) four
Answer: c
Clarification: tidyr provides three main functions for tidying your messy data: gather(), separate() and spread().
5. Point out the correct statement?
a) gather() makes “wide” data longer
b) Two functions are present for tidy data
c) separate() makes “wide” data longer
d) spread() function takes multiple columns
Answer: c
Clarification: Other names for gather include melt (reshape2), pivot (spreadsheets) and fold (databases).
6. Which of the following function takes multiple columns?
a) spread()
b) gather()
c) separate()
d) extract()
Answer: b
Clarification: gather() gathers column into key-value pairs.
7. __________ uses regex groups instead of a splitting pattern or position.
a) spread()
b) gather()
c) separate()
d) extract()
Answer: c
Clarification: separate() allows you to tease columns apart.
8. Which of the following function works similar to separate()?
a) extract()
b) gather()
c) sep()
d) separate()
Answer: a
Clarification: extract() works in a similar way.
9. Which of the following d takes two columns and spreads them into multiple columns?
a) ggmissplot
b) printplot
c) print.ggplot
d) ggplot
Answer: c
Clarification: spread() makes “long” data wide.