Data Analysis with R Programming Q&A
Which of the following variables have names that follow widely accepted naming
convention rules? Select all that apply - (correct answer)plum_total_1
total_plums
These variable names use only lowercase letters and underscores and are clear,
concise, and meaningful.
In R, what includes reusable functions and documentation about how to use the
functions? - (correct answer)Packages
In R, packages include reusable R functions and documentation about how to use the
functions. They also include sample data sets and tests for checking your code.
When an analyst installs a package that is not in Base R, where does R call the
package from? - (correct answer)The CRAN archive
When an analyst installs a package that is not in Base R, R calls the package from the
CRAN archive. CRAN is an online archive with R packages and other R-related
resources.
When programming in R, what is a pipe used as an alternative for? - (correct
answer)Nested function
A pipe can be used as an alternative for a nested function. You can use both pipes and
nested functions to complete multiple operations on data. However, a pipe is often the
preferred method because it makes your code easier to read and understand.
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 write that code? - (correct
answer)Assignment
, The analyst can use an assignment operator to write the following code: daily_dosage
<- 50. In this code, the assignment operator <- is used to assign a value of 50 to the
variable daily_dosage.
An analyst runs code to convert string data into a date/time data type that results in the
following: "2020-07-10". Which of the following are examples of code that would lead to
this return? Select all that apply. - (correct answer)The code that would lead to the value
of "2020-07-10" are ymd(20200710) and mdy("July 10th, 2020").
Both of these code chunks use the date/time functions that convert string data types to
date/time data types.
You want to create a vector with the values 12, 23, 51, in that exact order. After
specifying the variable, what R code chunk allows you to create the vector? - (correct
answer)c(12, 23, 51)
allows you to create a vector with the values 12, 23, 51. A vector is a group of data
elements of the same type stored in a sequence in R. You can create a vector by putting
the values you want inside the parentheses of the combine function.
A data analyst is working with a dataset in R that has more than 50,000 observations.
Why might they choose to use a tibble instead of the standard data frame? Select all
that apply. - (correct answer)Tibbles automatically only preview the first 10 rows of data
Tibbles automatically only preview as many columns as fit on screen
Tibbles make printing in R easier. They won't accidentally overload the data analyst's
console because they're automatically set to pull up only the first 10 rows and as many
columns as fit on screen.
Which of the following variables have names that follow widely accepted naming
convention rules? Select all that apply - (correct answer)plum_total_1
total_plums
These variable names use only lowercase letters and underscores and are clear,
concise, and meaningful.
In R, what includes reusable functions and documentation about how to use the
functions? - (correct answer)Packages
In R, packages include reusable R functions and documentation about how to use the
functions. They also include sample data sets and tests for checking your code.
When an analyst installs a package that is not in Base R, where does R call the
package from? - (correct answer)The CRAN archive
When an analyst installs a package that is not in Base R, R calls the package from the
CRAN archive. CRAN is an online archive with R packages and other R-related
resources.
When programming in R, what is a pipe used as an alternative for? - (correct
answer)Nested function
A pipe can be used as an alternative for a nested function. You can use both pipes and
nested functions to complete multiple operations on data. However, a pipe is often the
preferred method because it makes your code easier to read and understand.
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 write that code? - (correct
answer)Assignment
, The analyst can use an assignment operator to write the following code: daily_dosage
<- 50. In this code, the assignment operator <- is used to assign a value of 50 to the
variable daily_dosage.
An analyst runs code to convert string data into a date/time data type that results in the
following: "2020-07-10". Which of the following are examples of code that would lead to
this return? Select all that apply. - (correct answer)The code that would lead to the value
of "2020-07-10" are ymd(20200710) and mdy("July 10th, 2020").
Both of these code chunks use the date/time functions that convert string data types to
date/time data types.
You want to create a vector with the values 12, 23, 51, in that exact order. After
specifying the variable, what R code chunk allows you to create the vector? - (correct
answer)c(12, 23, 51)
allows you to create a vector with the values 12, 23, 51. A vector is a group of data
elements of the same type stored in a sequence in R. You can create a vector by putting
the values you want inside the parentheses of the combine function.
A data analyst is working with a dataset in R that has more than 50,000 observations.
Why might they choose to use a tibble instead of the standard data frame? Select all
that apply. - (correct answer)Tibbles automatically only preview the first 10 rows of data
Tibbles automatically only preview as many columns as fit on screen
Tibbles make printing in R easier. They won't accidentally overload the data analyst's
console because they're automatically set to pull up only the first 10 rows and as many
columns as fit on screen.