QuiztudyPREMIUM
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 AnswerC
value%2D
value-2QUESTION 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 AnswerD
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 AnswerC
mdy("2027-02-27")D
mdy(02272027)Correct AnswerQUESTION 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
LogicalB
ArithmeticCorrect AnswerC
RelationalD
AssignmentCorrect AnswerQUESTION 5 OF 43
Which of the following is a best practice when naming functions in R?
A
Function names should be very longB
Function names should start with a special characterC
Function names should be verbsCorrect AnswerD
Function names should be capitalizedQUESTION 6 OF 43
Which of the following are included in R packages? Select all that apply.
A
Naming conventions for R variable namesB
Reusable R functionsCorrect AnswerC
Tests for checking your codeCorrect AnswerD
Sample datasetsCorrect AnswerQUESTION 7 OF 43
Why would a data analyst want to use the CRAN network when working with RStudio?
A
To install drivers to RStudioB
To add pipes to RC
To install R packagesCorrect AnswerD
To add new operators to RQUESTION 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 AnswerB
2120C
1021D
1102QUESTION 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
RelationalB
ArithmeticC
LogicalD
AssignmentCorrect AnswerQUESTION 10 OF 43
Which of the following variables have names that follow widely accepted naming convention rules? Select all that apply.
A
total_plumsCorrect AnswerB
plum_total_1Correct AnswerC
*totalplumsCorrect AnswerD
1_plum_totalQUESTION 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 AnswerC
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 tidyverseB
PythonC
The RStudio websiteD
The CRAN archiveCorrect AnswerQUESTION 13 OF 43
Which of the following are examples of variable names that can be used in R? Select all that apply.
A
3_salesB
autos_5Correct AnswerC
utility2Correct AnswerD
_red_1QUESTION 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 AnswerB
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 AnswerD
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
ArithmeticB
LogicalC
AssignmentCorrect AnswerD
RelationalQUESTION 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 AnswerQUESTION 18 OF 43
R packages include sample datasets. They also include reusable R functions and documentation about how to use the functions.
A
TrueCorrect AnswerB
FalseQUESTION 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 AnswerC
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 AnswerB
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 AnswerD
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
RelationalB
LogicalC
AssignmentCorrect AnswerD
ArithmeticQUESTION 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 AnswerD
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 AnswerB
Recommended packagesC
CRAN packagesD
Community packagesQUESTION 25 OF 43
When programming in R, what is a pipe used as an alternative for?
A
VectorB
Installed packageC
VariableD
Nested functionCorrect AnswerQUESTION 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
ConditionalB
LogicalC
ArithmeticCorrect AnswerD
AssignmentQUESTION 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 AnswerB
title*123.RC
p1+infoonpatients.RD
patient_data.RCorrect AnswerQUESTION 28 OF 43
In R, what includes reusable functions and documentation about how to use the functions?
A
CommentsB
PackagesCorrect AnswerC
VectorsD
PipesQUESTION 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 AnswerB
FalseQUESTION 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 AnswerB
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 AnswerQUESTION 31 OF 43
Fill in the blank: When creating a variable for use in R, your variable name should begin with _____.
A
a letterCorrect AnswerB
a numberC
an operatorD
an underscoreQUESTION 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 AnswerD
Data elements are stored in a sequence.Correct AnswerQUESTION 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 AnswerD
ymd(20200710)Correct AnswerQUESTION 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
BaseB
CRANC
tidyverseCorrect AnswerD
RecommendedQUESTION 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 AnswerD
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 tidyverseB
A data frameC
A data typeD
A packageCorrect AnswerQUESTION 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
VectorC
Nested functionD
PipeCorrect AnswerQUESTION 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 AnswerB
“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
AssignmentB
ConditionalC
ArithmeticCorrect AnswerD
LogicalQUESTION 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
tidyrB
dplyrCorrect AnswerC
readrD
ggplot2QUESTION 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
ArgumentB
VectorC
CommentD
PipeCorrect AnswerQUESTION 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-2020B
2020_salesC
sales_2020Correct AnswerD
_2020salesQUESTION 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 AnswerD
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?