🌍 All Study Guides📊 Dashboard📰 Blog💡 About
Google Data Analytics Professional Certificate • STUDY MODE

PRACTICE QUIZ

QUESTION 1 OF 43

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

A
value(2)
B
value_2Correct Answer
C
value%2
D
value-2
QUESTION 2 OF 43

You want to create a vector with the values 21, 12, 39, in that exact order. After specifying the variable, what R code chunk lets you create the vector?

A
c(39, 12, 21)
B
v(21, 12, 39)
C
c(21, 12, 39)Correct Answer
D
v(39, 12, 21)
QUESTION 3 OF 43

A data analyst wants to create the date February 27th, 2027 using the lubridate functions. Which of the following are examples of code that would create this value? Select all that apply.

A
dmy(02272027)
B
ymd("2027-02-27")Correct Answer
C
mdy("2027-02-27")
D
mdy(02272027)Correct Answer
QUESTION 4 OF 43

A data analyst inputs the following code in RStudio: sales_1 <- (3500.00 * 12) Which of the following types of operators does the analyst use in the code? Select all that apply.

A
Logical
B
ArithmeticCorrect Answer
C
Relational
D
AssignmentCorrect Answer
QUESTION 5 OF 43

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

A
Function names should be very long
B
Function names should start with a special character
C
Function names should be verbsCorrect Answer
D
Function names should be capitalized
QUESTION 6 OF 43

Which of the following are included in R packages? Select all that apply.

A
Naming conventions for R variable names
B
Reusable R functionsCorrect Answer
C
Tests for checking your codeCorrect Answer
D
Sample datasetsCorrect Answer
QUESTION 7 OF 43

Why would a data analyst want to use the CRAN network when working with RStudio?

A
To install drivers to RStudio
B
To add pipes to R
C
To install R packagesCorrect Answer
D
To add new operators to R
QUESTION 8 OF 43

A data analyst finds the code mdy(10211020) in an R script. What is the year of the date that is created?

A
1020Correct Answer
B
2120
C
1021
D
1102
QUESTION 9 OF 43

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?

A
Relational
B
Arithmetic
C
Logical
D
AssignmentCorrect Answer
QUESTION 10 OF 43

Which of the following variables have names that follow widely accepted naming convention rules? Select all that apply.

A
total_plumsCorrect Answer
B
plum_total_1Correct Answer
C
*totalplumsCorrect Answer
D
1_plum_total
QUESTION 11 OF 43

How are base packages different from recommended packages in the R package ecosystem?

A
Recommended packages are made by the community and base packages are not.
B
Base packages are installed and loaded by default and recommended packages are not.Correct Answer
C
Base packages take longer to load than recommended packages.
D
Recommended packages are more professionally designed than base packages.
QUESTION 12 OF 43

What is the name of the popular package archive dedicated to supporting R users authentic, validated code?

A
The tidyverse
B
Python
C
The RStudio website
D
The CRAN archiveCorrect Answer
QUESTION 13 OF 43

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

A
3_sales
B
autos_5Correct Answer
C
utility2Correct Answer
D
_red_1
QUESTION 14 OF 43

You want to create a vector with the values 12, 23, 51, in that exact order. After specifying the variable, what R code chunk lets you create the vector?

A
c(12, 23, 51)Correct Answer
B
v(12, 23, 51)
C
c(51, 23, 12)
D
v(51, 23, 12)
QUESTION 15 OF 43

An analyst comes across dates listed as strings in a dataset. For example, December 10th, 2020. To convert the strings to a date/time data type, which function should the analyst use?

A
datetime()
B
now()
C
mdy()Correct Answer
D
lubridate()
QUESTION 16 OF 43

A data analyst inputs the following code in RStudio: change_1 <- 70 Which of the following types of operators does the analyst use in the code?

A
Arithmetic
B
Logical
C
AssignmentCorrect Answer
D
Relational
QUESTION 17 OF 43

Which of the following is a best practice when naming R script files?

A
R script file names should end in “.S”
B
R script file names should end in “.rscript”
C
R script file names should end in “.r-script”
D
R script file names should end in “.R”Correct Answer
QUESTION 18 OF 43

R packages include sample datasets. They also include reusable R functions and documentation about how to use the functions.

A
TrueCorrect Answer
B
False
QUESTION 19 OF 43

What is the relationship between RStudio and CRAN?

A
CRAN creates visualizations based on an analyst’s programming in RStudio.
B
RStudio installs packages from CRAN that are not in Base R.Correct Answer
C
CRAN contains all of the data that RStudio users need for analysis.
D
RStudio and CRAN are both environments where data analysts can program using R code.
QUESTION 20 OF 43

A data analyst writes the following code in a script and gets an error. What is wrong with their code? penguins %>% filter(flipper_length_mm == 200) %>% group_by(species) %>% summarize(mean = mean(body_mass_g)) %>%

A
The last line should not have a pipe operator.Correct Answer
B
They are using too many functions.
C
The first line should have a pipe operator before penguins.
D
They are using the wrong characters for the pipe operator.
QUESTION 21 OF 43

You want to create a vector with the values 43, 56, 12 in that exact order. After specifying the variable, what R code chunk lets you create the vector?

A
c(12, 56, 43)
B
v(43, 56, 12)
C
c(43, 56, 12)Correct Answer
D
v(12, 56, 43)
QUESTION 22 OF 43

A data analyst wants to store a vector in a variable. What type of operator would they use to do this?

A
Relational
B
Logical
C
AssignmentCorrect Answer
D
Arithmetic
QUESTION 23 OF 43

Which of the following is a best practice when naming variables in R?

A
Variable names should start with special characters.
B
Variable names should be verbs.
C
Use lowercase for variable names.Correct Answer
D
Use a space character to separate words in variable names.
QUESTION 24 OF 43

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

A
Base packagesCorrect Answer
B
Recommended packages
C
CRAN packages
D
Community packages
QUESTION 25 OF 43

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

A
Vector
B
Installed package
C
Variable
D
Nested functionCorrect Answer
QUESTION 26 OF 43

A data analyst inputs the following code in RStudio: print(100 / 10) What type operators does the analyst use in the code?

A
Conditional
B
Logical
C
ArithmeticCorrect Answer
D
Assignment
QUESTION 27 OF 43

Which of the following files in R have names that follow widely accepted naming convention rules? Select all that apply.

A
patient_details_1.RCorrect Answer
B
title*123.R
C
p1+infoonpatients.R
D
patient_data.RCorrect Answer
QUESTION 28 OF 43

In R, what includes reusable functions and documentation about how to use the functions?

A
Comments
B
PackagesCorrect Answer
C
Vectors
D
Pipes
QUESTION 29 OF 43

Packages installed in RStudio are called from CRAN. CRAN is an online archive with R packages and other R-related resources.

A
TrueCorrect Answer
B
False
QUESTION 30 OF 43

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

A
Pipes make it easier to read long sequences of functions.Correct Answer
B
Pipes allow you to combine more functions in a single sequence.
C
Nested functions are no longer supported by R.
D
Pipes make it easier to add or remove functions.Correct Answer
QUESTION 31 OF 43

Fill in the blank: When creating a variable for use in R, your variable name should begin with _____.

A
a letterCorrect Answer
B
a number
C
an operator
D
an underscore
QUESTION 32 OF 43

Which of the following statements about vectors in R are correct? Select all that apply.

A
Data elements are defined using curly braces.
B
All data must be stored in vectors.
C
All data elements must have the same data type.Correct Answer
D
Data elements are stored in a sequence.Correct Answer
QUESTION 33 OF 43

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.

A
myd(2020, July 10)
B
dmy(“7-10-2020”)
C
mdy(“July 10th, 2020”)Correct Answer
D
ymd(20200710)Correct Answer
QUESTION 34 OF 43

A data analyst needs a system of packages that use a common design philosophy for data manipulation, exploration, and visualization. What set of packages fulfills their need

A
Base
B
CRAN
C
tidyverseCorrect Answer
D
Recommended
QUESTION 35 OF 43

A data analyst wants to take a data frame named people and filter the data where age is 10, arranged by height, and grouped by gender. Which code snippet would perform those operations in the specified order? filter(age == 10) + arrange(height) + group_by(gender) group_by(gender) %>% arrange(height) %>% filter(age == 10)

A
filter( arrange( group_by( people, gender ), height ) , age == 10 )
B
people %>%
C
group_by( arrange( filter( people, age == 10 ), height ), gender )Correct Answer
D
people %>%
QUESTION 36 OF 43

A data analyst wants to create functions, documentation, sample data sets, and code test that they can share and reuse in other projects. What should they create to help them accomplish this?

A
A tidyverse
B
A data frame
C
A data type
D
A packageCorrect Answer
QUESTION 37 OF 43

A data analyst is reviewing some code and finds the following code chunk: mtcars %>% filter(carb > 1) %>% group_by(cyl) %>% What is this code chunk an example of?

A
Data framec)
B
Vector
C
Nested function
D
PipeCorrect Answer
QUESTION 38 OF 43

If you use the mdy() function in R to convert the string “April 10, 2019”, what will return when you run your code?

A
“2019-4-10”Correct Answer
B
“4.10.19”
C
“2019-10-4”
D
“4/10/2019”
QUESTION 39 OF 43

A data analyst wants to combine values using mathematical operations. What type of operator would they use to do this?

A
Assignment
B
Conditional
C
ArithmeticCorrect Answer
D
Logical
QUESTION 40 OF 43

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?

A
tidyr
B
dplyrCorrect Answer
C
readr
D
ggplot2
QUESTION 41 OF 43

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?

A
Argument
B
Vector
C
Comment
D
PipeCorrect Answer
QUESTION 42 OF 43

A data analyst is assigning a variable to a value in their company’s sales data set for 2020. Which variable name uses the correct syntax?

A
-sales-2020
B
2020_sales
C
sales_2020Correct Answer
D
_2020sales
QUESTION 43 OF 43

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?

A
myd()
B
dmy()
C
mdy()Correct Answer
D
ymd()

Ready to test your recall?

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

A
value(2)
B
value_2
C
value%2
D
value-2

How confident are you in this answer?