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

PRACTICE QUIZ

QUESTION 1 OF 76

Your team already uses R. Why might they benefit from adopting R Markdown? Select all that apply.

A
R Markdown makes it easy to reproduce an analysis.Correct Answer
B
R Markdown allows adding code to slide presentations.
C
R Markdown performs analysis without writing code.
D
R Markdown allows exporting reports that document your analysis.Correct Answer
QUESTION 2 OF 76

A data analyst wants to change their header to be one font size smaller. What should they add to their markdown syntax?

A
Backtick
B
HashtagCorrect Answer
C
Double space
D
Exclamation mark
QUESTION 3 OF 76

A data analyst wants to include a line of code directly in their .rmd file in order to explain their process more clearly. What is this code called?

A
Markdown
B
YAML
C
Documented
D
Inline codeCorrect Answer
QUESTION 4 OF 76

What symbol can be used to add bullet points in R Markdown?

A
Exclamation marks
B
Brackets
C
Backticks
D
AsterisksCorrect Answer
QUESTION 5 OF 76

Which sample correctly implements a code chunk in a .rmd file? value <- 8 ``` value <- 8 ``` (CORRECT) value <- 8 --- value <- 8 ###

A
```{!}
B
```{r}
C
---
D
###
QUESTION 6 OF 76

Why would a data analyst create a template of their .rmd file? Select all that apply.

A
To prevent other users from editing the file
B
To save time when creating the same kind of documentCorrect Answer
C
To create an interactive notebook
D
To customize the appearance of a final reportCorrect Answer
QUESTION 7 OF 76

A data analyst wants to create documentation for their cleaning process so other analysts on their team can recreate this process. What tool can help them create this shareable report?

A
R MarkdownCorrect Answer
B
Inline code
C
Dashboards
D
Code chunks
QUESTION 8 OF 76

Fill in the blank: R Markdown notebooks can be converted into HTML, PDF, and Word documents, slide presentations, and _____.

A
tables
B
dashboardsCorrect Answer
C
YAML
D
spreadsheets
QUESTION 9 OF 76

A data analyst writes two hashtags next to their header. What will this do to the header font in the .rmd file?

A
Make it smallerCorrect Answer
B
Make it a different color
C
Make it bigger
D
Make it centered
QUESTION 10 OF 76

Which pieces of markdown text will produce a result that is italicized? Select all that apply.

A
_text_Correct Answer
B
**text*Correct Answer
C
*text*Correct Answer
D
* text
QUESTION 11 OF 76

A data analyst includes a code chunk in their .rmd file. What does this allow other users to do? Select all that apply.

A
Modify code directly from the .rmd fileCorrect Answer
B
Copy code directly from the .rmd fileCorrect Answer
C
Undo original project code directly from the .rdm file
D
Execute code directly from the .rmd fileCorrect Answer
QUESTION 12 OF 76

A data analyst who works with R creates a weekly sales report by remaking their .rmd file and converting it to a report. What can they do to streamline this process?

A
Create an R notebook
B
Knit their .rmd file
C
Convert their .rmd file
D
Create a templateCorrect Answer
QUESTION 13 OF 76

What are the benefits of working with R Markdown? Select all that apply.

A
R Markdown makes it possible to use larger datasets.
B
R Markdown runs interactive code chunks.Correct Answer
C
R Markdown runs R code faster.
D
R Markdown allows styled text between code.Correct Answer
QUESTION 14 OF 76

A data analyst finishes editing an R Markdown notebook and wants to convert it to a new format they can share. What are their options? Select all that apply.

A
Markdown
B
DashboardsCorrect Answer
C
Word documentsCorrect Answer
D
Slide presentationsCorrect Answer
QUESTION 15 OF 76

Which code snippet implements the correct syntax for writing a piece of hyperlinked text in markdown?

A
>link–www.cousera.com<
B
[link](www.coursera.com )Correct Answer
C
(link)[www.coursera.com]
D
link**www.coursera.com
QUESTION 16 OF 76

A data analyst wants to make a word in their markdown stand out by making it bold. What characters should they surround the text with to achieve the bold style?

A
Double hashtag (##)
B
Single asterisk (*)
C
Double asterisks (**)Correct Answer
D
Angle brackets (<>)
QUESTION 17 OF 76

R Markdown is a file format for making dynamic documents with R. What are the benefits of creating this kind of document? Select all that apply.

A
Generate a report with executable code chunksCorrect Answer
B
Perform calculations for analysis more efficiently
C
Save, organize, and document codeCorrect Answer
D
Create a record of your cleaning processCorrect Answer
QUESTION 18 OF 76

A data analyst wants to export their R Markdown notebook as a text document. What are the text document formats they can use to share their R Markdown notebook? Select all that apply.

A
PDFCorrect Answer
B
HTMLCorrect Answer
C
WordCorrect Answer
D
Notepad
QUESTION 19 OF 76

Which combination of text characters can be used to embed an image in a markdown document?

A
##
B
![]()Correct Answer
C
*[]()
D
<>
QUESTION 20 OF 76

What is the purpose of the Knit button in R Studio?

A
It combines multiple .rmd files into a single file.
B
It imports the content from a .rmd file.
C
It creates a new .rmd file.
D
It exports the .rmd file to another document type.Correct Answer
QUESTION 21 OF 76

A data analyst adds a section of executable code to their .rmd file so users can execute it and generate the correct output. What is this section of code called?

A
YAML
B
Data plot
C
Documentation
D
Code chunkCorrect Answer
QUESTION 22 OF 76

A data analyst is inserting a line of code directly into their .rmd file. What will they use to mark the beginning and end of the code?

A
Hashtags
B
Markdown
C
DelimitersCorrect Answer
D
Asterisks
QUESTION 23 OF 76

Fill in the blank: If an analyst creates the same kind of document over and over or customizes the appearance of a final report, they can use _____ to save them time.

A
a code chunk
B
a templateCorrect Answer
C
a filter
D
an .rmd file
QUESTION 24 OF 76

A data analyst wants to change the default file format that gets exported by the Knit button to .pdf. What field of the YAML header should they change to set the new default file format?

A
title
B
export
C
outputCorrect Answer
D
author
QUESTION 25 OF 76

When you Knit a file in RStudio what part of code chunks are shown by default?

A
The code
B
The delimiter
C
The outputCorrect Answer
D
The YAML
QUESTION 26 OF 76

A data analyst inputs asterisks before a word of phrase in R Markdown. How will this appear in the document?

A
As a numerical list
B
As a code chunk
C
As inline code
D
As bullet pointsCorrect Answer
QUESTION 27 OF 76

Fill in the blank: Code added to an .rmd file is usually referred to as a code _____. This allows users to execute R code from within the .rmd file.

A
file
B
chunkCorrect Answer
C
filter
D
section
QUESTION 28 OF 76

A data analyst adds specific characters before and after their code chunk to mark where the data item begins and ends in the .rmd file. What are these characters called?

A
DelimitersCorrect Answer
B
Markdown
C
Backticks
D
Syntax
QUESTION 29 OF 76

A data analyst wants to perform an analysis and make it easy for colleagues to understand his process and update the analysis a year from now. Which tool is best to achieve this objective?

A
Word Document
B
R MarkdownCorrect Answer
C
PDF document
D
Code chunks
QUESTION 30 OF 76

What does the ```{r} delimiter (three backticks followed by an r contained inside curly brackets) indicate in an R Markdown notebook? COURSE CHALLENGE

A
The start of YAML metadata
B
The end of a code chunk
C
The end of YAML metadata
D
The start of a code chunkCorrect Answer
QUESTION 31 OF 76

Scenario 1, questions 1-7 As part of the data science team at Gourmet Analytics, you use data analytics to advise companies in the food industry. You clean, organize, and visualize data to arrive at insights that will benefit your clients. As a member of a collaborative team, sharing your analysis with others is an important part of your job. Your current client is Chocolate and Tea, an up-and-coming chain of cafes. ( Image S2Q1 ) The eatery combines an extensive menu of fine teas with chocolate bars from around the world. Their diverse selection includes everything from plantain milk chocolate, to tangerine white chocolate, to dark chocolate with pistachio and fig. The encyclopedic list of chocolate bars is the basis of Chocolate and Tea’s brand appeal. Chocolate bar sales are the main driver of revenue. Chocolate and Tea aims to serve chocolate bars that are highly rated by professional critics. They also continually adjust the menu to make sure it reflects the global diversity of chocolate production. The management team regularly updates the chocolate bar list in order to align with the latest ratings and to ensure that the list contains bars from a variety of countries. They’ve asked you to collect and analyze data on the latest chocolate ratings. In particular, they’d like to know which countries produce the highest-rated bars of super dark chocolate (a high percentage of cocoa). This data will help them create their next chocolate bar menu. Your team has received a dataset that features the latest ratings for thousands of chocolates from around the world. Click here to access the dataset. Given the data and the nature of the work you will do for your client, your team agrees to use R for this project. Your supervisor asks you to write a short summary of the benefits of using R for the project. Which of the following benefits would you include in your summary? Select all that apply.

A
Define a problem and ask the right questions
B
Easily reproduce and share the analysisCorrect Answer
C
Create high-quality data visualizationsCorrect Answer
D
Quickly process lots of dataCorrect Answer
Explanation:

The benefits of using R for the project include the ability to quickly process lots of data and create high-quality data visualizations. You can also easily reproduce and share your analysis.

QUESTION 32 OF 76

Scenario 1, continued Before you begin working with your data, you need to import it and save it as a data frame. To get started, you open your RStudio workspace and load the tidyverse library. You upload a .csv file containing the data to RStudio and store it in a project folder named flavors_of_cacao.csv. You use the read_csv() function to import the data from the .csv file. Assume that the name of the data frame is chocolate_df and the .csv file is in the working directory. What code chunk lets you create the data frame? Explanation : The code chunk chocolate_df <-read_csv("flavors_of_cacao.csv") lets you create the data frame. In this code chunk: chocolate_df is the name of the data frame that will store the data. <- is the assignment operator to assign values to the data frame. read_csv() is the function that will import the data to the data frame. "flavors_of_cacao.csv" is the file name that read.csv() function takes for its argument.

A
chocolate_df + read_csv("flavors_of_cacao.csv")
B
read_csv("flavors_of_cacao.csv") + chocolate_df
C
chocolate_df <-read_csv("flavors_of_cacao.csv")Correct Answer
D
chocolate_df <- "flavors_of_cacao.csv"(read_csv)
QUESTION 33 OF 76

Scenario 1, continued Now that you’ve created a data frame, you want to find out more about how the data is organized. The data frame has hundreds of rows and lots of columns. Assume the name of your data frame is flavors_df. What code chunk lets you review the column names in the data frame?

A
colnames(flavors_df)Correct Answer
B
col(flavors_df)
C
rename(flavors_df)
D
arrange(flavors_df)
Explanation:

You write the code chunk colnames(flavors_df). In this code chunk: colnames() is the function that will let you review the column names in the data frame. flavors_df is the name of the data frame that the colnames() function takes for its argument.

QUESTION 34 OF 76

Scenario 2, continued A teammate creates a new plot based on the chocolate bar data. The teammate asks you to make some revisions to their code. Assume your teammate shares the following code chunk: ggplot(data = best_trimmed_flavors_df) + geom_bar(mapping = aes(x = Rating)) + What code chunk do you add to the third line to create wrap around facets of the variable Rating?

A
facet_wrap(~Rating)Correct Answer
B
facet(~Rating)
C
facet_wrap(Rating~)
D
facet_wrap(Rating)
Explanation:

You write the code chunk facet_wrap(~Rating). In this code chunk: facet_wrap() is the function that lets you create wrap around facets of a variable. Inside the parentheses of the facet_wrap() function, type a tilde symbol (~) followed by the name of the variable (Rating).

QUESTION 35 OF 76

Scenario 2, continued Your team has created some basic visualizations to explore different aspects of the chocolate bar data. You’ve volunteered to add titles to the plots. You begin with a scatterplot. Assume the first part of your code chunk is: ggplot(data = trimmed_flavors_df) + geom_point(mapping = aes(x = Cocoa.Percent, y = Rating)) + What code chunk do you add to the third line to add the title Best Chocolates to your plot?

A
labs(title = “Best Chocolates”)Correct Answer
B
labs(title <- "Best Chocolates
C
labs("Best Chocolates" = title)
D
labs("Best Chocolates")
Explanation:

You write the code chunk labs(title = “Best Chocolates”). In this code chunk: labs() is the function that lets you add a title to your plot. In the parentheses of the labs() function, write the word title, then an equals sign, then the specific text of the title in quotation marks (“Best Chocolates”).

QUESTION 36 OF 76

Scenario 2, continued Next, you create a new scatterplot to explore the relationship between different variables. You want to save your plot so you can access it later on. You know that the ggsave() function defaults to saving the last plot that you displayed in RStudio, so you’re ready to write the code to save your scatterplot. Assume your first two lines of code are: ggplot(data = trimmed_flavors_df) + geom_point(mapping = aes(x = Cocoa.Percent, y = Rating)) + What code chunk do you add to the third line to save your plot as a jpeg file with chocolate as the file name?

A
ggsave(“chocolate.jpeg”)Correct Answer
B
ggsave(chocolate.jpeg)
C
ggsave(“jpeg.chocolate”)
D
ggsave(“chocolate.png”)
Explanation:

You add the code chunk ggsave(“chocolate.jpeg”) to save your plot as a jpeg file with “chocolate” as the file name. In this code chunk: Inside the parentheses of the ggsave() function, type a quotation mark followed by the file name (chocolate), then a period, then the type of file format (jpeg), then a closing quotation mark.

QUESTION 37 OF 76

Scenario 2, continued As a final step in the analysis process, you create a report to document and share your work. Before you share your work with the management team at Chocolate and Tea, you are going to meet with your team and get feedback. Your team wants the documentation to include all your code and display all your visualizations. Fill in the blank: You want to record and share every step of your analysis, let teammates run your code, and display your visualizations. You decide to create _____ to document your work.

A
a data frame
B
an R Markdown notebookCorrect Answer
C
a database
D
a spreadsheet
Explanation:

You use an R Markdown notebook to document your work. The notebook lets you record and share every step of your analysis, lets your teammates run your code, and displays your visualizations.

QUESTION 38 OF 76

Scenario 2, continued A teammate creates a new plot based on the chocolate bar data. The teammate asks you to make some revisions to their code. Assume your teammate shares the following code chunk: ggplot(data = best_trimmed_flavors_df) + geom_bar(mapping = aes(x = Cocoa.Percent)) + What code chunk do you add to the third line to create wrap around facets of the variable Cocoa.Percent?

A
facet_wrap(%>%Cocoa.Percent)
B
facet_wrap(Cocoa.Percent~)
C
facet(=Cocoa.Percent)
D
facet_wrap(~Cocoa.Percent)Correct Answer
Explanation:

You write the code chunk facet_wrap(~Cocoa.Percent). In this code chunk: facet_wrap() is the function that lets you create wrap around facets of a variable. Inside the parentheses of the facet_wrap() function, type a tilde symbol (~) followed by the name of the variable (Cocoa.Percent).

QUESTION 39 OF 76

Scenario 2, continued Your team has created some basic visualizations to explore different aspects of the chocolate bar data. You’ve volunteered to add titles to the plots. You begin with a scatterplot. Assume the first part of your code chunk is: ggplot(data = trimmed_flavors_df) + geom_point(mapping = aes(x = Cocoa.Percent, y = Rating)) + What code chunk do you add to the third line to add the title Suggested Chocolate to your plot?

A
labs <- "Suggested Chocolate"
B
labs(Suggested Chocolate)
C
labs(Suggested Chocolate = title)
D
labs(title = “Suggested Chocolate”)Correct Answer
Explanation:

You write the code chunk labs(title = “Suggested Chocolate”). In this code chunk: labs() is the function that lets you add a title to your plot. In the parentheses of the labs() function, write the word title, then an equals sign, then the specific text of the title in quotation marks (“Suggested Chocolate”).

QUESTION 40 OF 76

Scenario 2, continued Next, you create a new scatterplot to explore the relationship between different variables. You want to save your plot so you can access it later on. You know that the ggsave() function defaults to saving the last plot that you displayed in RStudio, so you’re ready to write the code to save your scatterplot. Assume your first two lines of code are: ggplot(data = trimmed_flavors_df) + geom_point(mapping = aes(x = Cocoa.Percent, y = Rating)) What code chunk do you add to the third line to save your plot as a png file with chocolate as the file name?

A
ggsave(“chocolate”)
B
ggsave(“chocolate.png”)Correct Answer
C
ggsave(chocolate.png)
D
ggsave(“png.chocolate”)
Explanation:

You write the code chunk ggsave(“chocolate.png”). In this code chunk: Inside the parentheses of the ggsave() function, type a quotation mark followed by the file name (chocolate), then a period, then the type of file format (png), then a closing quotation mark

QUESTION 41 OF 76

Scenario 1, questions 1-7 As part of the data science team at Gourmet Analytics, you use data analytics to advise companies in the food industry. You clean, organize, and visualize data to arrive at insights that will benefit your clients. As a member of a collaborative team, sharing your analysis with others is an important part of your job. Your current client is Chocolate and Tea, an up-and-coming chain of cafes. ( Image S2Q11 ) The eatery combines an extensive menu of fine teas with chocolate bars from around the world. Their diverse selection includes everything from plantain milk chocolate, to tangerine white chocolate, to dark chocolate with pistachio and fig. The encyclopedic list of chocolate bars is the basis of Chocolate and Tea’s brand appeal. Chocolate bar sales are the main driver of revenue. Chocolate and Tea aims to serve chocolate bars that are highly rated by professional critics. They also continually adjust the menu to make sure it reflects the global diversity of chocolate production. The management team regularly updates the chocolate bar list in order to align with the latest ratings and to ensure that the list contains bars from a variety of countries. They’ve asked you to collect and analyze data on the latest chocolate ratings. In particular, they’d like to know which countries produce the highest-rated bars of super dark chocolate (a high percentage of cocoa). This data will help them create their next chocolate bar menu. Your team has received a dataset that features the latest ratings for thousands of chocolates from around the world. Click here to access the dataset. Given the data and the nature of the work you will do for your client, your team agrees to use R for this project. A teammate asks you about the benefits of using R for the project. You mention that R can quickly process lots of data and create high quality data visualizations. What is another benefit of using R for the project?

A
Choose a topic for analysis
B
Easily reproduce and share an analysisCorrect Answer
C
Define a problem and ask the right questions
D
Automatically clean data
Explanation:

Another benefit of using R for the project is that it can easily reproduce and share an analysis.

QUESTION 42 OF 76

Scenario 1, continued Now that you’ve created a data frame, you want to find out more about how the data is organized. The data frame has hundreds of rows and lots of columns. Assume the name of your data frame is flavors_df. What code chunk lets you review the structure of the data frame?

A
str(flavors_df)Correct Answer
B
select(flavors_df)
C
summarize(flavors_df)
D
filter(flavors_df)
Explanation:

You write the code chunk str(flavors_df). In this code chunk: str() is the function that will return the structure of the data frame, and give you high-level information like the column names and the type of data contained in those columns. flavors_df is the name of the data frame that the str() function takes for its argument.

QUESTION 43 OF 76

Scenario 1, continued Next, you begin to clean your data. When you check out the column headings in your data frame you notice that the first column is named Company...Maker.if.known. (Note: The period after known is part of the variable name.) For the sake of clarity and consistency, you decide to rename this column Maker (without a period at the end). Assume the first part of your code chunk is: flavors_df %>% What code chunk do you add to change the column name?

A
rename(Maker = Company...Maker.if.known.)Correct Answer
B
rename(Company...Maker.if.known. = Maker)
C
rename(Company...Maker.if.known %<% Maker)
D
rename(Maker %<% Company...Maker.if.known.)
Explanation:

You write the code chunk rename(Maker = Company...Maker.if.known.). In this code chunk: rename() is the function that will change the name of your column. Inside the parentheses of the function, write the new name (Maker), then an equal sign, then the name you want to change (Company...Maker.if.known.).

QUESTION 44 OF 76

Scenario 2, continued As a final step in the analysis process, you create a report to document and share your work. Before you share your work with the management team at Chocolate and Tea, you are going to meet with your team and get feedback. Your team wants the documentation to include all your code and display all your visualizations. You decide to create an R Markdown notebook to document your work. What are your reasons for choosing an R Markdown notebook? Select all that apply.

A
It automatically creates a website to show your work
B
It lets you record and share every step of your analysisCorrect Answer
C
It displays your data visualizationsCorrect Answer
D
It allows users to run your codeCorrect Answer
Explanation:

You choose an R Markdown notebook to document your work because it lets you record and share every step of your analysis. The notebook allows users to run your code and also displays your data visualizations.

QUESTION 45 OF 76

Scenario 1, continued Now that you’ve created a data frame, you want to find out more about how the data is organized. The data frame has hundreds of rows and lots of columns. Assume the name of your data frame is flavors_df. What code chunk lets you get a glimpse of the contents of the data frame?

A
glimpse = flavors_df
B
glimpse %>% flavors_df
C
glimpse(flavors_df)Correct Answer
D
glimpse <- flavors_df
Explanation:

You write the code chunk glimpse(flavors_df). In this code chunk: glimpse() is the function that will give you a glimpse of the contents of the data frame, and give you high-level information like column names and the type of data contained in those columns. flavors_df is the name of the data frame that the glimpse() function takes for its argument.

QUESTION 46 OF 76

You finish working with an R Markdown notebook and now you need to distribute your work. How can you export your analysis as a styled report?

A
Use the Contents Menu
B
Use markdown text
C
Use the Knit ButtonCorrect Answer
D
Use two hashtags
QUESTION 47 OF 76

Fill in the blank: A delimiter is a character that indicates the beginning or end of _____.

A
a data itemCorrect Answer
B
a header
C
a section
D
an analysis
QUESTION 48 OF 76

A data analyst wants to change the default file format that gets exported by the Knit button in RStudio. Where should they change the output format?

A
In the Contents menu
B
In markdown text
C
In the YAML metadataCorrect Answer
D
In a code chunk
QUESTION 49 OF 76

What delimiter is used to indicate the YAML metadata in an R Markdown notebook?

A
---Correct Answer
B
```{r}
C
```
D
###
QUESTION 50 OF 76

What type of export document should you use while you are working and don’t need to worry about adding page breaks in the correct places?

A
HTMLCorrect Answer
B
Word
C
PDF
D
YAML
QUESTION 51 OF 76

A data analyst wants to create a shareable report of their analysis with documentation of their process and notes explaining their code to stakeholders. What tool can they use to generate this?

A
Filters
B
Dashboards
C
R MarkdownCorrect Answer
D
Code chunks
QUESTION 52 OF 76

Fill in the blank: A data analyst includes _____ in their R Markdown notebook so that they can refer to it directly in their explanation of their analysis.

A
markdown
B
documentation
C
YAML
D
inline codeCorrect Answer
QUESTION 53 OF 76

A data analyst wants to add a bulleted list to their R Markdown document. What symbol can they type to create this formatting?

A
Brackets
B
AsterisksCorrect Answer
C
Hashtags
D
Delimiters
QUESTION 54 OF 76

A data analyst is working in a .rmd file and comes across the text ```{r analysis}. What is the purpose of the text “analysis”?

A
It is a label for the code chunkCorrect Answer
B
It changes the way the code gets exported
C
It runs the code in analysis mode
D
It alters the output file format of Knit
QUESTION 55 OF 76

What does the --- delimiter (three hyphens) indicate in an R Markdown notebook?

A
YAML metadataCorrect Answer
B
Bold text
C
Code chunk
D
Italic text
QUESTION 56 OF 76

A data analyst is regularly exporting documents from a .rmd file and manually customizing the appearance of the document they give to stakeholders. What would allow them to automatically customize the appearance of the document?

A
A YAML header
B
A delimiter
C
An inline code snippet
D
A templateCorrect Answer
QUESTION 57 OF 76

A data analyst notices that their header is much smaller than they wanted it to be. What happened?

A
They have too few asterisks
B
They have too many hashtagsCorrect Answer
C
They have too many asterisks
D
They have too few hashtags
QUESTION 58 OF 76

A data analyst works with an .rmd file in RStudio and wants the ability to quickly find a code chunk using the label “analysis”. Which code example would allow the analyst to quickly access the code chunk using this label?

A
```analysis{r}
B
```{analysis r}
C
```{r analysis}Correct Answer
D
```{r} analysis
QUESTION 59 OF 76

Scenario 1, questions 1-7 As part of the data science team at Gourmet Analytics, you use data analytics to advise companies in the food industry. You clean, organize, and visualize data to arrive at insights that will benefit your clients. As a member of a collaborative team, sharing your analysis with others is an important part of your job. Your current client is Chocolate and Tea, an up-and-coming chain of cafes. ( Image S4Q1 ) The eatery combines an extensive menu of fine teas with chocolate bars from around the world. Their diverse selection includes everything from plantain milk chocolate, to tangerine white chocolate, to dark chocolate with pistachio and fig. The encyclopedic list of chocolate bars is the basis of Chocolate and Tea’s brand appeal. Chocolate bar sales are the main driver of revenue. Chocolate and Tea aims to serve chocolate bars that are highly rated by professional critics. They also continually adjust the menu to make sure it reflects the global diversity of chocolate production. The management team regularly updates the chocolate bar list in order to align with the latest ratings and to ensure that the list contains bars from a variety of countries. They’ve asked you to collect and analyze data on the latest chocolate ratings. In particular, they’d like to know which countries produce the highest-rated bars of super dark chocolate (a high percentage of cocoa). This data will help them create their next chocolate bar menu. Your team has received a dataset that features the latest ratings for thousands of chocolates from around the world. Click here to access the dataset. Given the data and the nature of the work you will do for your client, your team agrees to use R for this project. You create a short document about the benefits of using R for the project and share the document with your team. You write that the benefits include R’s ability to quickly process lots of data and easily reproduce and share an analysis. What is another benefit of using R for the project?

A
Create high-quality visualizationsCorrect Answer
B
Define a problem and ask the right questions
C
Automatically clean data
D
Choose a topic for analysis
Explanation:

Another benefit of using R for the project is R’s ability to create high-quality data visualizations.

QUESTION 60 OF 76

Scenario 1, continued Before you begin working with your data, you need to import it and save it as a data frame. To get started, you open your RStudio workspace and load all the necessary libraries and packages. You upload a .csv file containing the data to RStudio and store it in a project folder named flavors_of_cacao.csv. You use the read_csv() function to import the data from the .csv file. Assume that the name of the data frame is flavors_df and the .csv file is in the working directory. What code chunk lets you create the data frame?

A
flavors_df + read_csv("flavors_of_cacao.csv")
B
flavors_df <- read_csv("flavors_of_cacao.csv")Correct Answer
C
read_csv("flavors_of_cacao.csv") <- flavors_df
D
read_csv(flavors_df <- "flavors_of_cacao.csv")
Explanation:

The code chunk: flavors_df <- read_csv("flavors_of_cacao.csv") lets you create the data frame. In this code chunk: flavors_df is the name of the data frame that will store the data. <- is the assignment operator to assign values to the data frame. read_csv() is the function that will import the data to the data frame. "flavors_of_cacao.csv" is the file name that read.csv() function takes for its argument.

QUESTION 61 OF 76

After previewing and cleaning your data, you determine what variables are most relevant to your analysis. Your main focus is on Rating, Cocoa.Percent, and Company. You decide to use the select() function to create a new data frame with only these three variables. Assume the first part of your code is: trimmed_flavors_df <- flavors_df %>% Add the code chunk that lets you select the three variables. 1 What company appears in row 1 of your tibble?

A
A. MorinCorrect Answer
B
Rogue
C
Videri
D
Soma
Explanation:

You add the code chunk select(Rating, Cocoa.Percent, Company) to select the three variables. The correct code is trimmed_flavors_df <- flavors_df %>% select(Rating, Cocoa.Percent, Company). In this code chunk: The select() function lets you select specific variables for your new data frame. select() takes the names of the variables you want to choose as its argument: Rating, Cocoa.Percent, Company. The company A. Morin appears in row 1 of your tibble.

QUESTION 62 OF 76

Next, you select the basic statistics that can help your team better understand the ratings system in your data. Assume the first part of your code is: trimmed_flavors_df %>% You want to use the summarize() and mean() functions to find the mean rating for your data. Add the code chunk that lets you find the mean value for the variable Rating. 1 Run Reset What is the mean rating?

A
3.185933Correct Answer
B
3.995445
C
4.701337
D
4.230765
Explanation:

You add the code chunk summarize(mean(Rating)) to find the mean value for the variable Rating. The correct code is trimmed_flavors_df %>% summarize(mean(Rating)). In this code chunk: The summarize() function lets you display summary statistics. You can use the summarize() function in combination with other functions such as mean(), sd(), and max() to calculate specific statistics. In this case, you use mean() to calculate the mean value for the variable Rating. The mean rating is 3.185933.

QUESTION 63 OF 76

After completing your analysis of the rating system, you determine that any rating greater than or equal to 3.9 points can be considered a high rating. You also know that Chocolate and Tea considers a bar to be super dark chocolate if the bar's cocoa percent is greater than or equal to 75%. You decide to create a new data frame to find out which chocolate bars meet these two conditions. Assume the first part of your code is: best_trimmed_flavors_df <- trimmed_flavors_df %>% You want to apply the filter() function to the variables Cocoa.Percent and Rating. Add the code chunk that lets you filter the data frame for chocolate bars that contain at least 75% cocoa and have a rating of at least 3.9 points. 1 What value for cocoa percent appears in row 1 of your tibble?

A
80%
B
88%
C
75%Correct Answer
D
78%
Explanation:

The code chunk filter(Cocoa.Percent >= 75, Rating >= 3.9) lets you filter the data frame for chocolate bars that contain at least 75% cocoa and have a rating of at least 3.9 points. The correct code is best_trimmed_flavors_df <- trimmed_flavors_df %>% filter(Cocoa.Percent >= 75, Rating >= 3.9). In this code chunk: The filter() function lets you filter your data frame based on specific criteria. Cocoa.Percent and Rating refer to the variables you want to filter. The >= operator signifies “greater than or equal to.” The new data frame will show all the values of Cocoa.Percent greater than or equal to 75, and all the values of Rating greater than or equal to 3.9. The value 75% for cocoa percent appears in row 1 of your tibble.

QUESTION 64 OF 76

Now that you’ve cleaned and organized your data, you’re ready to create some useful data visualizations. Your team assigns you the task of creating a series of visualizations based on requests from the Chocolate and Tea management team. You decide to use ggplot2 to create your visuals. Assume your first line of code is: ggplot(data = best_trimmed_flavors_df) + You want to use the geom_bar() function to create a bar chart. Add the code chunk that lets you create a bar chart with the variable Rating on the x-axis. 1 How many bars does your bar chart display?

A
6
B
2Correct Answer
C
5
D
3
Explanation:

You add the code chunk geom_bar(mapping = aes(x = Rating)) to create a bar chart with the variable Rating on the x-axis. The correct code is ggplot(data = best_trimmed_flavors_df) + geom_bar(mapping = aes(x = Rating)). In this code chunk: geom_bar() is the geom function that uses bars to create a bar chart. Inside the parentheses of the aes() function, the code x = Rating maps the x aesthetic to the variable Rating. Rating will appear on the x-axis of the plot. By default, R will put a count of the variable Rating on the y-axis. Your bar chart displays 2 bars.

QUESTION 65 OF 76

Your bar chart reveals the locations that produce the highest rated chocolate bars. To get a better idea of the specific rating for each location, you’d like to highlight each bar. Assume that you are working with the code chunk: ggplot(data = best_trimmed_flavors_df) + geom_bar(mapping = aes(x = Company.Location)) Add a code chunk to the second line of code to map the aesthetic color to the variable Rating. NOTE: the three dots (...) indicate where to add the code chunk. 1 geom_bar(mapping = aes(x = Company.Location, ...)) According to your bar chart, which two company locations produce the highest rated chocolate bars?

A
Amsterdam and U.S.A.
B
Canada and FranceCorrect Answer
C
Scotland and France
D
Canada and U.S.A.
Explanation:

You add the code chunk color = Rating to the second line of code to map the aesthetic color to the variable Rating. The correct code is ggplot(data = best_trimmed_flavors_df) + geom_bar(mapping = aes(x = Company.Location, color = Rating)). In this code chunk: Inside the parentheses of the aes() function, after the comma that follows x = Company.Location, write the aesthetic (color), then an equals sign, then the variable (Rating). The specific rating of each location will appear as a specific color that outlines each bar of your bar chart. On your visualization, the legend titled "Rating" shows the color coding for the variable Rating. Lighter blues correspond to higher ratings and darker blues correspond to lower ratings. According to your bar chart, the two company locations that produce the highest rated chocolate bars are Canada and France.

QUESTION 66 OF 76

Scenario 2, continued A teammate creates a new plot based on the chocolate bar data. The teammate asks you to make some revisions to their code. Assume your teammate shares the following code chunk: ggplot(data = best_trimmed_flavors_df) + geom_bar(mapping = aes(x = Company)) + What code chunk do you add to the third line to create wrap around facets of the variable Company?

A
facet_wrap(=Company)
B
facet_wrap(~Company)Correct Answer
C
facet(Company)
D
facet_wrap(+Company)
Explanation:

You write the code chunk facet_wrap(~Company). In this code chunk: facet_wrap() is the function that lets you create wrap around facets of a variable. Inside the parentheses of the facet_wrap() function, type a tilde symbol (~) followed by the name of the variable (Company).

QUESTION 67 OF 76

Scenario 2, continued Your team has created some basic visualizations to explore different aspects of the chocolate bar data. You’ve volunteered to add titles to the plots. You begin with a scatterplot. Assume the first part of your code chunk is: ggplot(data = trimmed_flavors_df) + geom_point(mapping = aes(x = Cocoa.Percent, y = Rating)) + What code chunk do you add to the third line to add the title Recommended Bars to your plot?

A
labs(title + "Recommended Bars")
B
labs("Recommended Bars")
C
labs(title = Recommended Bars)
D
labs(title = “Recommended Bars”)Correct Answer
Explanation:

You write the code chunk labs(title = “Recommended Bars”). In this code chunk: labs() is the function that lets you add a title to your plot. In the parentheses of the labs() function, write the word title, then an equals sign, then the specific text of the title in quotation marks (“Recommended Bars”).

QUESTION 68 OF 76

Scenario 1, continued Before you begin working with your data, you need to import it and save it as a data frame. To get started, you open your RStudio workspace and load the tidyverse library. You upload a .csv file containing the data to RStudio and store it in a project folder named flavors_of_cacao.csv. You use the read_csv() function to import the data from the .csv file. Assume that the name of the data frame is bars_df and the .csv file is in the working directory. What code chunk lets you create the data frame?

A
bars_df + read_csv("flavors_of_cacao.csv")
B
read_csv("flavors_of_cacao.csv") + bars_df
C
bars_df <- read_csv("flavors_of_cacao.csv")Correct Answer
D
bars_df %>% read_csv("flavors_of_cacao.csv")
Explanation:

The code chunk bars_df <- read_csv("flavors_of_cacao.csv") lets you create the data frame. In this code chunk: bars_df is the name of the data frame that will store the data. <- is the assignment operator to assign values to the data frame. read_csv() is the function that will import the data to the data frame. "flavors_of_cacao.csv" is the file name that read.csv() function takes for its argument.

QUESTION 69 OF 76

Next, you select the basic statistics that can help your team better understand the ratings system in your data. Assume the first part of your code is: trimmed_flavors_df %>% You want to use the summarize() and sd() functions to find the standard deviation of the rating for your data. Add the code chunk that lets you find the standard deviation for the variable Rating. 1 What is the standard deviation of the rating?

A
0.3720475
B
0.4780624Correct Answer
C
0.4458434
D
0.2951794
Explanation:

You add the code chunk summarize(sd(Rating)) to find the standard deviation for the variable Rating. The correct code is trimmed_flavors_df %>% summarize(sd(Rating)). In this code chunk: The summarize() function lets you display summary statistics. You can use the summarize() function in combination with other functions such as mean(), max(), and min() to calculate specific statistics. In this case, you use sd() to calculate the standard deviation statistic for the variable Rating. The standard deviation of the rating is 0.4780624.

QUESTION 70 OF 76

After completing your analysis of the rating system, you determine that any rating greater than or equal to 3.5 points can be considered a high rating. You also know that Chocolate and Tea considers a bar to be super dark chocolate if the bar's cocoa percent is greater than or equal to 70%. You decide to create a new data frame to find out which chocolate bars meet these two conditions. Assume the first part of your code is: best_trimmed_flavors_df <- trimmed_flavors_df %>% You want to apply the filter() function to the variables Cocoa.Percent and Rating. Add the code chunk that lets you filter the data frame for chocolate bars that contain at least 70% cocoa and have a rating of at least 3.5 points. 1 What rating appears in row 1 of your tibble?

A
4.25
B
4.00
C
3.75
D
3.50Correct Answer
Explanation:

The code chunk filter(Cocoa.Percent >= 70, Rating >= 3.5) lets you filter the data frame for chocolate bars that contain at least 70% cocoa and have a rating of at least 3.5 points. The correct code is best_trimmed_flavors_df <- trimmed_flavors_df %>% filter(Cocoa.Percent >= 70, Rating >= 3.5). In this code chunk: The filter() function lets you filter your data frame based on specific criteria. Cocoa.Percent and Rating refer to the variables you want to filter. The >= operator signifies “greater than or equal to.” The new data frame will show all the values of Cocoa.Percent greater than or equal to 70, and all the values of Rating greater than or equal to 3.5. The rating 3.50 appears in row 1 of your tibble.

QUESTION 71 OF 76

Fill in the blank: Markdown is a _____ for formatting plain text files.

A
syntaxCorrect Answer
B
coding language
C
guide
D
file application
QUESTION 72 OF 76

A data analyst creates an interactive version of their R Markdown document to share with other users that allows them to execute code the analyst wrote. What did they create?

A
An HTML report
B
A code chunk
C
An R notebookCorrect Answer
D
A markdown
QUESTION 73 OF 76

A data analyst wants to convert their R Markdown file into another format. What are their options? Select all that apply.

A
Slide presentationCorrect Answer
B
JPEG, PNG, and GIF
C
DashboardCorrect Answer
D
HTML, PDF, and WordCorrect Answer
QUESTION 74 OF 76

A data analyst has finished editing their R Markdown file and wants to save it as an HTML report. What tool will they use?

A
Output
B
Hashtags
C
KnitCorrect Answer
D
Save
QUESTION 75 OF 76

R Markdown allows you to create a record of the steps you took to complete your analysis directly in RStudio.

A
TrueCorrect Answer
B
False
QUESTION 76 OF 76

Where in RStudio can you find the export menu for saving plots?

A
The R console pane
B
The plots tabCorrect Answer
C
The source editor pane
D
The environment pane

Ready to test your recall?

Your team already uses R. Why might they benefit from adopting R Markdown? Select all that apply.

💡Select all 2 correct answers before submitting (0 of 2 selected).
A
R Markdown makes it easy to reproduce an analysis.
B
R Markdown allows adding code to slide presentations.
C
R Markdown performs analysis without writing code.
D
R Markdown allows exporting reports that document your analysis.

How confident are you in this answer?