Week 2 – Programming using RStudio – Shuffle Q/A 3

31. What type of packages are automatically installed and loaded to use in R studio when you start your first programming session?

  • Recommended packages
  • Base packages
  • Community packages
  • CRAN packages

32. Why would you want to use pipes instead of nested functions in R? Select all that apply.

  • Pipes make it easier to add or remove functions.
  • Pipes make it easier to read long sequences of functions.
  • Nested functions are no longer supported by R.
  • Pipes allow you to combine more functions in a single sequence.

33. Which of the following are examples of variable names that can be used in R?

  • value(2)
  • value-2
  • value_2
  • value%2

34. A data analyst has a dataset that contains date strings like "January 10th, 2022." What lubridate function can they use to convert these strings to dates?

  • myd()
  • mdy()
  • dmy()
  • ymd()

35. What is the relationship between RStudio and CRAN?

  • RStudio and CRAN are both environments where data analysts can program using R code.
  • CRAN creates visualizations based on an analyst’s programming in RStudio.
  • CRAN contains all of the data that RStudio users need for analysis.
  • RStudio installs packages from CRAN that are not in Base R.

36. A data analyst previously created a series of nested functions that carry out multiple operations on some data in R. The analyst wants to complete the same operations but make the code easier to understand for their stakeholders. Which of the following can the analyst use to accomplish this?

  • Pipe
  • Comment
  • Argument
  • Vector

37. A data analyst wants to assign the value 50 to the variable daily_dosage. Which of the following types of operators will they need to use in the code?

  • Relational
  • Arithmetic
  • Assignment
  • Assignment

38. A data analyst needs to find a package that offers a consistent set of functions that help them complete common data manipulation tasks like selecting and filtering. What tidyverse package provides this functionality?

  • tidyr
  • readr
  • ggplot2
  • dplyr

39. When programming in R, what is a pipe used as an alternative for?

  • Nested function
  • Variable
  • Installed package
  • Vector

40. Which of the following is a best practice when naming functions in R?

  • Function names should be capitalized
  • Function names should be verbs
  • Function names should be very long
  • Function names should start with a special character

Devendra Kumar

Project Management Apprentice at Google

Leave a Reply