Which of the following examples can you use in r for date/time data? select all that apply.

Get All Week Data Analysis with R Programming Coursera Quiz Answers

This course is the seventh course in the Google Data Analytics Certificate. These courses will equip you with the skills needed to apply to introductory-level data analyst jobs. In this course, you’ll learn about the programming language known as R. You’ll find out how to use RStudio, the environment that allows you to work with R. This course will also cover the software applications and tools that are unique to R, such as R packages. You’ll discover how R lets you clean, organize, analyze, visualize, and report data in new and more powerful ways. Current Google data analysts will continue to instruct and provide you with hands-on ways to accomplish common data analyst tasks with the best tools and resources.

SKILLS YOU WILL GAIN

  • R Programming
  • Data Analysis
  • Data Visualization (DataViz)
  • R Markdown
  • Rstudio

Here you will Get Data Analysis with R Programming Coursera Quiz Answers

All Quiz Answers for Week 1

Quiz 1 >>Weekly challenge 1

Q1. A data analyst uses words and symbols to give instructions to a computer. What are the words and symbols known as?

  1. Function language
  2. Syntax language
  3. Programming language
  4. Coded language

Q2. Many data analysts prefer to use a programming language for which of the following reasons? Select all that apply.

  1. To choose a topic for analysis
  2. To easily reproduce and share an analysis
  3. To save time
  4. To clarify the steps of an analysis

Q3. Which of the following are benefits of open-source code? Select all that apply.

  1. Anyone can pay a fee for access to the code
  2. Anyone can use the code for free
  3. Anyone can create an add-on package for the code
  4. Anyone can fix bugs in the code

Q4. For what reasons do many data analysts choose to use R? Select all that apply.

  1. R is a data-centric programming language
  2. R can create high quality visualizations
  3. R is a closed source programming language
  4. R can quickly process lots of data

Q5. A data analyst needs to quickly create a series of scatterplots to visualize a very large dataset. What should they use for the analysis?

  1. A dashboard
  2. A slide presentation
  3. Structured query language
  4. R programming language

Q6. RStudio’s integrated development environment includes which of the following? Select all that apply.

  1. A viewer for playing videos
  2. An area to manage loaded data
  3. A console for executing commands
  4. An editor for writing code

Q7. Fill in the blank: When you execute code in the source editor, the code automatically also appears in the _____.

  1. plots tab
  2. R console
  3. environment pane
  4. files tab

Q8. In RStudio, where can you find and manage all the data you currently have loaded?

  1. Plots tab
  2. R console pane
  3. Environment pane
  4. Source editor pane

All Quiz Answers for Week 2

Quiz 1 >>Weekly challenge

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

  1. 2020_sales
  2. _2020sales
  3. sales_2020
  4. -sales-2020

Q2. 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?

  1. v(51, 23, 12)
  2. c(51, 23, 12)
  3. c(12, 23, 51)
  4. v(12, 23, 51)

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

  1. “2019-10-4”
  2. “4/10/2019”
  3. “2019-04-10”
  4. “4.10.19”

Q4. 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?

  1. Assignment
  2. Arithmetic
  3. Relational
  4. Logical

Q5. A data analyst is deciding on naming conventions for an analysis that they are beginning in R. Which of the following rules are widely accepted stylistic conventions that the analyst should use when naming variables? Select all that apply.

  1. Begin all variable names with an underscore
  2. Use all lowercase letters in variable names
  3. Use single letters, such as “x” to name all variables
  4. Use an underscore to separate words within a variable name

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

  1. Pipes
  2. Comments
  3. Packages
  4. Vectors

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

  1. True
  2. False

Q8. 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?

  1. Pipe
  2. Vector
  3. Argument
  4. Comment

All Quiz Answers for Week 3

Quiz 1 >>Weekly challenge 3

Q1. A data analyst creates a data frame with data that has more than 50,000 observations in it. When they print their data frame, it slows down their console. To avoid this, they decide to switch to a tibble. Why would a tibble be more useful in this situation?

  1. Tibbles only include a limited number of data items
  2. Tibbles will automatically create row names to make the data easier to read
  3. Tibbles won’t overload the console because they automatically only print the first 10 rows of data and as many variables as will fit on the screen
  4. Tibbles will automatically change the names of variables to make them shorter and easier to read

Q2. A data analyst is working with a large data frame. It contains so many columns that they don’t all fit on the screen at once. The analyst wants a quick list of all of the column names to get a better idea of what is in their data. What function should they use?

  1. head()
  2. mutate()
  3. str()
  4. colnames()

Q3. You are working with the ToothGrowth dataset. You want to use the glimpse() function to get a quick summary of the dataset. Write the code chunk that will give you this summary.

How many variables does the ToothGrowth dataset contain?

  1. 5
  2. 2
  3. 4
  4. 3

Q4. A data analyst is working with a data frame named sales. They write the following code:

sales %>%

The data frame contains a column named q1_sales. What code chunk does the analyst add to change the name of the column from q1_sales to quarter1_sales ?

  1. rename(q1_sales = quarter1_sales)
  2. rename(quarter1_sales <- “q1_sales”)
  3. rename(q1_sales <- “quarter1_sales”)
  4. rename(quarter1_sales = q1_sales)

Q5. A data analyst is working with the penguins data. The variable species includes three penguin species: Adelie, Chinstrap, and Gentoo. The analyst wants to create a data frame that only includes the Adelie species. The analyst receives an error message when they run the following code:

penguins %>%

  filter(species <- “Adelie”)

How can the analyst change the second line of code to correct the error?

  1. filter(Adelie == species)
  2. filter(species == “Adelie”)
  3. filter(“Adelie”)
  4. filter(“Adelie” <- species)

Q6. You are working with the penguins dataset. You want to use the summarize() and mean() functions to find the mean value for the variable body_mass_g. You write the following code:

penguins %>%

drop_na() %>%

group_by(species) %>%

Add the code chunk that lets you find the mean value for the variable body_mass_g.

1RunReset

What is the mean body mass in g for the Adelie species?

  1. 5092.437
  2. 4207.433
  3. 3733.088
  4. 3706.164

Q7. A data analyst is working with a data frame called salary_data. They want to create a new column named total_wages that adds together data in the standard_wages and overtime_wages columns. What code chunk lets the analyst create the total_wages column?

  1. mutate(salary_data, total_wages = standard_wages * overtime_wages)
  2. mutate(total_wages = standard_wages + overtime_wages)
  3. mutate(salary_data, total_wages = standard_wages + overtime_wages)
  4. mutate(salary_data, standard_wages = total_wages + overtime_wages)

Q8. A data analyst is working with a data frame named retail. It has separate columns for dollars (price_dollars) and cents (price_cents). The analyst wants to combine the two columns into a single column named price, with the dollars and cents separated by a decimal point. For example, if the value in the price_dollars column is 10, and the value in the price_cents column is 50, the value in the price column will be 10.50. What code chunk lets the analyst create the price column?

  1. unite(retail, “price”, price_cents, sep=”.”)
  2. unite(retail, “price”, price_dollars, price_cents, sep=”.”)
  3. unite(retail, price_dollars, price_cents, sep=”.”)
  4. unite(retail, “price”, price_dollars, price_cents)

Q9. In R, which statistical measure demonstrates how strong the relationship is between two variables?

  1. Correlation
  2. Standard deviation
  3. Average
  4. Maximum

Q10. A data analyst uses the bias() function to compare the actual outcome with the predicted outcome to determine if the model is biased. They get a score of 0.8. What does this mean?

  1. Bias can be determined
  2. Bias cannot be determined
  3. The model is biased
  4. The model is not biased

All Quiz Answers for Week 4

Quiz 1 >>Weekly challenge 4

Q1. Which of the following tasks can you complete with ggplot2 features? Select all that apply.

  1. Create many different types of plots
  2. Add labels and annotations to a plot
  3. Automatically clean data before creating a plot
  4. Customize the visual features of a plot

Q2. A data analyst creates a bar chart with the diamonds dataset. They begin with the following line of code:

ggplot(data = diamonds)

What symbol should the analyst put at the end of the line of code to add a layer to the plot?

  1. The equal sign (=)
  2. The plus sign (+)
  3. The ampersand symbol (&)
  4. The pipe operator (%>%)

Q3. A data analyst creates a plot using the following code chunk:

ggplot(data = penguins) + geom_point(mapping = aes(x = flipper_length_mm, y = body_mass_g))

Which of the following represents a variable in the code chunk? Select all that apply.

  1. x
  2. body_mass_g
  3. flipper_length_mm
  4. y

Q4. Fill in the blank: In ggplot2, the term mapping refers to the connection between variables and _____ .

  1. data frames
  2. aesthetics
  3. geoms
  4. facets

Q5. A data analyst creates a scatterplot with a lot of data points. The analyst wants to make some points on the plot more transparent than others. What aesthetic should the analyst use?

  1. Alpha
  2. Color
  3. Fill
  4. Shape

Q6. You are working with the penguins dataset. You create a scatterplot with the following code: 

ggplot(data = penguins) +

geom_point(mapping = aes(x = flipper_length_mm, y = body_mass_g))

You want to highlight the different penguin species on your plot. Add a code chunk to the second line of code to map the aesthetic shape to the variable species.

NOTE: the three dots (…) indicate where to add the code chunk.

1

geom_point(mapping = aes(x = flipper_length_mm, y = body_mass_g, ...))RunReset

Which penguin species does your visualization display?

  1. Adelie, Gentoo, Macaroni
  2. Adelie, Chinstrap, Gentoo
  3. Emperor, Chinstrap, Gentoo
  4. Adelie, Chinstrap, Emperor

Q7. A data analyst creates a plot with the following code chunk:

ggplot(data = penguins) + geom_jitter(mapping = aes(x = flipper_length_mm, y = body_mass_g))

What does the geom_jitter() function do to the points in the plot?

  1. Adds random colors to each point in the plot
  2. Decrease the size of each point in the plot
  3. Adds a small amount of random shapes at each point in the plot
  4. Adds a small amount of random noise to each point in the plot

Q8. You are working with the diamonds dataset. You create a bar chart with the following code:

ggplot(data = diamonds) +

geom_bar(mapping = aes(x = color, fill = cut)) +

You want to use the facet_wrap() function to display subsets of your data. Add the code chunk that lets you facet your plot based on the variable clarity.

1RunReset

How many subplots does your visualization show?

  1. 7
  2. 9
  3. 6
  4. 8

Q9. A data analyst creates a scatterplot. The analyst wants to put a text label on the plot to call out specific data points. What function does the analyst use?

  1. The ggplot() function
  2. The geom_smooth() function
  3. The facet_grid() function
  4. The annotate() function

Q10. You are working with the penguins dataset. You create a scatterplot with the following lines of code: 

ggplot(data = penguins) + 

  geom_point(mapping = aes(x = flipper_length_mm, y = body_mass_g)) + 

What code chunk do you add to the third line to save your plot as a png file with “penguins” as the file name?

  1. ggsave(“penguins”)
  2. ggsave(penguins.png)
  3. ggsave(“penguins.png”)
  4. ggsave(“png.penguins”)

All Quiz Answers for Week 5

Quiz 1 >>Weekly challenge 5

Q1. 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?

  1. Code chunks
  2. Dashboards
  3. Filters
  4. R Markdown

Q2. 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.

  1. Slide presentations
  2. Markdown
  3. Word documents
  4. Dashboards

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

  1. They have too many asterisks
  2. They have too many hashtags
  3. They have too few hashtags
  4. They have too few asterisks

Q4. 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.

  1. documentation
  2. inline code
  3. markdown
  4. YAML

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

  1. Brackets
  2. Delimiters
  3. Hashtags
  4. Asterisks

Q6. 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?

  1. YAML
  2. Code chunk
  3. Data plot
  4. Documentation

Q7. 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?

  1. Delimiters
  2. Backticks
  3. Syntax
  4. Markdown

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

  1. To customize the appearance of a final report
  2. To prevent other users from editing the file
  3. To save time when creating the same kind of document
  4. To create an interactive notebook

Quiz 1 >>Course challenge

Q1. 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.

Which of the following examples can you use in r for date/time data? select all that apply.

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.

  1. Easily reproduce and share the analysis
  2. Create high-quality data visualizations
  3. Quickly process lots of data
  4. Define a problem and ask the right questions

Q2. 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?

  1. bars_df + read_csv(“flavors_of_cacao.csv”)
  2. bars_df %>% read_csv(“flavors_of_cacao.csv”)
  3. bars_df <- read_csv(“flavors_of_cacao.csv”)
  4. read_csv(“flavors_of_cacao.csv”) + bars_df

Q3. 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?

  1. glimpse %>% flavors_df
  2. glimpse <- flavors_df
  3. glimpse = flavors_df
  4. glimpse(flavors_df)

Q4. 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 Company (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? 

  1. rename(Company <- Company…Maker.if.known.)
  2. rename(Company…Maker.if.known. = Company) 
  3. rename(Company = Company…Maker.if.known.)
  4.  rename(Company…Maker.if.known. <- Company) 

Q5. 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 Bean.Type. 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.

1RunReset

What bean type appears in row 6 of your tibble?

  1. Forastero
  2. Beniano
  3. Trinitario
  4. Criollo

Q6. 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.

1RunReset

What is the standard deviation of the rating?

  1. 0.3720475
  2. 0.4780624
  3. 0.2951794
  4. 0.4458434

Q7. 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.

1RunReset

What value for cocoa percent appears in row 1 of your tibble?

  1. 88%
  2. 78%
  3. 80%
  4. 75%

Q8. 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.

1RunReset

How many bars does your bar chart display?

1 point

  1. 6
  2. 5
  3. 3
  4. 2

Q9. 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 following code:

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 fill to the variable Rating.

NOTE: the three dots (…) indicate where to add the code chunk.

1

geom_bar(mapping = aes(x = Company.Location, ...))RunReset

According to your bar chart, which two company locations produce the highest rated chocolate bars?

  1. Amsterdam and France
  2. Canada and France
  3. Scotland and U.S.A.
  4. Scotland and Canada

Q10. 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?

  1. facet_wrap(Rating)
  2. facet_wrap(Rating~)
  3. facet_wrap(~Rating)
  4. facet(~Rating)

Q11. 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?

  1. labs(title = Recommended Bars)
  2. labs(“Recommended Bars”)
  3. labs(title = “Recommended Bars”)
  4. labs(title + “Recommended Bars”)

Q12. 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?

  1. ggsave(“chocolate.png”)
  2. ggsave(“jpeg.chocolate”)
  3. ggsave(“chocolate.jpeg”)
  4. ggsave(chocolate.jpeg)

Q13. 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.

  1. It automatically creates a website to show your work
  2. It lets you record and share every step of your analysis
  3. It allows users to run your code
  4. It displays your data visualizations
Recap:

I hope this article would be helpful for you to find all the coursera Quiz Answers.
If this article helped you learn something new for free, let others know about this,
Want to learn more? Check out another course.

Enroll on Coursera

<<<Check out another Coursera Quiz Answers >>>

Crash Course on Python Coursera Quiz Answers

The Bits and Bytes of Computer Networking Coursera Quiz Answers

Introduction to User Experience Design Coursera Quiz Answers

Django Features and Libraries Coursera Quiz Answers

Using JavaScript JQuery and JSON in Django Coursera Quiz Answers

What are the data types in R?

R's basic data types are character, numeric, integer, complex, and logical. R's basic data structures include the vector, list, matrix, data frame, and factors.

Which of the following are included in R packages select all that apply 1 point?

R packages include reusable R functions, sample datasets, and tests for checking your code. R packages also include documentation about how to use the included functions.

What should you use to assign a value to a variable in R?

In R programming, assign() method is used to assign the value to a variable in an environment.

When using RStudio What does the installed packages () function do?

Packages are collections of R functions, data, and compiled code in a well-defined format. When you install a package it gives you access to a set of commands that are not available in the base R set of functions. The directory where packages are stored is called the library. R comes with a standard set of packages.