Table of Contents
Week 01: Data Analysis with R Programming Coursera Quiz Answers
Test your knowledge of programming languages
Q1. Fill in the blank: Programming involves _____ a computer to perform an action or set of actions.
[expand title=View Answer] instructing [/expand]
Q2. What are Python, JavaScript, SAS, Scala, and Julia?
[expand title=View Answer] Programming languages [/expand]
Q3. What are the benefits of using a programming language to work with your data? Select all that apply.
[expand title=View Answer]
1.Clarify the steps of your analysis
2.Easily reproduce and share your work
3.Save time
[/expand]
Quiz- 2
Q1. Open-source code is only available to people who pay a subscription fee.
[expand title=View Answer]False [/expand]
Q2. The R programming language can be used for which of the following tasks? Select all that apply.
[expand title=View Answer]
1.Data analysis
2.Visualization
3.Statistical analysis
[/expand]
Q3. Which of the following terms best describes the R programming language?
[expand title=View Answer] Data-centric [/expand]
Test your knowledge of programming with RStudio
Q1. What type of software application is RStudio?
[expand title=View Answer] Integrated development environment [/expand]
Q2. RStudio includes which of the following panes? Select all that apply.
[expand title=View Answer]
1.Environment pane
2.Source editor pane
[/expand]
Q3. If you write code directly in the R console, RStudio will automatically save your code when you close your current session.
[expand title=View Answer] False [/expand]
Data Analysis with R Programming Weekly Challenge 1 Answers
Q1. A data analyst uses words and symbols to give instructions to a computer. What are the words and symbols known as?
[expand title=View Answer] Programming language[/expand]
Q2. Many data analysts prefer to use a programming language for which of the following reasons? Select all that apply.
[expand title=View Answer]
1.To easily reproduce and share an analysis
2.To clarify the steps of an analysis
3.To save time
[/expand]
Q3. Which of the following are the benefits of open-source code? Select all that apply.
[expand title=View Answer]
1.Anyone can fix bugs in the code
2.Anyone can create an add-on package for the code
3.Anyone can use the code for free
[/expand]
Q4. Fill in the blank: The benefits of using _____ for data analysis include the ability to quickly process lots of data and create high-quality visualizations.
[expand title=View Answer] The R programming language [/expand]
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?
[expand title=View Answer] R programming language [/expand]
Q6. RStudio’s integrated development environment lets you perform which of the following actions? Select all that apply.
[expand title=View Answer]
1.Install R packages
2.Create data visualizations
3.Import data from spreadsheets
[/expand]
Q7. In which two parts of RStudio can you execute code? Select all that apply.
[expand title=View Answer]
1.The source editor pane
2.The R console pane
[/expand]
Q8. Fill in the blank: In RStudio, the _____ is where you can find all the data you currently have loaded, and can easily organize and save it.
[expand title=View Answer] environment pane [/expand]
Week 02: Data Analysis with R Programming Coursera Quiz Answers
Test your knowledge of programming concepts
Q1. Why do analysts use comments In R programming? Select all that apply.
[expand title=View Answer] To make an R Script more readable[/expand]
Q2. What should you use to assign a value to a variable in R?
[expand title=View Answer]An operator [/expand]
Q3. Which of the following examples is the proper syntax for calling a function in R? 1 point
[expand title=View Answer]print() [/expand]
Q4. Which of the following examples can you use in R for date/time data? Select all that apply. 1 point
[expand title=View Answer]
1.2018-12-21 16:35:28 UTC
2.2019-04-16
3.06:11:13 UTC
4.07/24-2018
[/expand]
Test your knowledge of coding in R
Q1. An analyst includes the following calculation in their R programming: midyear_sales <- (quarter_1_sales + quarter_2_sales) - overhead_costs
Which variable will the total from this calculation be assigned to?
[expand title=View Answer]
1.midyear_sales
2.quarter_1_sales
3.quarter_2_sales
4.overhead_costs
[/expand]
Q2. An analyst is checking the value of the variable x using a logical operator, so they run the following code:
[expand title=View Answer] x > 35 & x < 65[/expand]
Which values of x would return TRUE
when the analyst runs the code? Select all that apply.
[expand title=View Answer]
1.50
2.60
[/expand]
Q3. Which of the following functions can analysts use to create conditional statements in their R programming? Select all that apply.
[expand title=View Answer]
1.print()
2.else()
3.if()
4.c()
[/expand]
Test your knowledge of R packages
Q1. When using RStudio, what does the installed.packages() function do?
[expand title=View Answer] Presents a list of packages currently installed in an RStudio session [/expand]
Q2. In data analytics, what is CRAN?
[expand title=View Answer] A commonly used online archive with R packages and other R resources [/expand]
Q3. What are ggplot2, tidyr, dplyr, and forcats all a part of?
[expand title=View Answer] A collection of core tidyverse packages [/expand]
Test your knowledge of the tidyverse
Q1. When working in R, for which part of the data analysis process do analysts use the tidyr package?
[expand title=View Answer]Data cleaning [/expand]
Q2. Which tidyverse package contains a set of functions, such as select(), that help with data manipulation?
[expand title=View Answer] dplyr [/expand]
Q3. An analyst is organizing a dataset in RStudio using the following code:
arrange(filter(Storage_1, inventory >= 40), count)
Which of the following examples is a nested function in the code?
[expand title=View Answer] filter [/expand]
Data Analysis with R Programming Weekly Challenge 2 Answers
Q1. Which of the following is an example of a piece of R code that contains both a function and an argument?
[expand title=View Answer]
1.print(“peaches”)
2.weekly_sales <- 7450
3.#filter
4.mass > 1000
[/expand]
Q2. 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?
[expand title=View Answer]
1._2020sales
2.sales_2020
3.-sales-2020
4.2020_sales
[/expand]
Q3. 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?
[expand title=View Answer]
1.v(12, 23, 51)
2.c(12, 23, 51)
3.c(51, 23, 12)
4.v(51, 23, 12)
[/expand]
Q4. 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?
[expand title=View Answer] mdy() [/expand]
Q5. 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.
[expand title=View Answer]
1.Assignment
2.Arithmetic
[/expand]
Q6. A data analyst is deciding on naming conventions for 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.
[expand title=View Answer]
1.Use an underscore to separate words within a variable name
2.Use all lowercase letters in variable names
[/expand]
Q7. Which of the following are included in R packages? Select all that apply.
[expand title=View Answer]
1.Tests for checking your code
2.Sample datasets
3.Reusable R functions
[/expand]
Q8. Packages installed in RStudio are called from CRAN. CRAN is an online archive with R packages and other R-related resources.
[expand title=View Answer] True[/expand]
Q9. When programming in R, what is a pipe used as an alternative?
[expand title=View Answer] Nested function [/expand]
Week 03: Data Analysis with R Programming Coursera Quiz Answers
Test your knowledge of R data frames
Q1. Which of the following are best practices for creating data frames? Select all that apply.
[expand title=View Answer]
1.Columns should be named
2.Each column should contain the same number of data items
[/expand]
Q2. Why are tibbles a useful variation of data frames?
[expand title=View Answer]Tibbles make printing easier [/expand]
Q3. Tidy data is a way of standardizing the organization of data within R.
[expand title=View Answer] True [/expand]
Q4. Which R function can be used to make changes to a data frame?
[expand title=View Answer]mutate() [/expand]
Test your knowledge of cleaning data
Q1. A data analyst is cleaning their data in R. They want to be sure that their column names are unique and consistent to avoid any errors in their analysis. What R function can they use to do this automatically?
[expand title=View Answer] clean_names()[/expand]
Q2. A data analyst is trying to sort the penguins bill_length_mm data in descending order. They input the following code:
penguins %>%
What code does the analyst add to organize the column bill_length_mm in descending order?
[expand title=View Answer]
1.arrange(-bill_length_mm)
2.arrange(=bill_length_mm)
3.arrange(+bill_length_mm)
4.arrange(%>%bill_length_mm)
[/expand]
Q3. A data analyst is working with customer information from their company’s sales data. The first and last names are in separate columns, but they want to create one column with both names instead. Which of the following functions can they use?
[expand title=View Answer] unite()[/expand]
Test your knowledge of R functions
Q1. Which of the following functions can a data analyst use to get a statistical summary of their dataset? Select all that apply.
[expand title=View Answer]
1.cor()
2.sd()
3.mean()
[/expand]
Q2. A data analyst inputs the following command:
quartet %>% group_by(set) %>% summarize(mean(x), sd(x), mean(y), sd(y), cor(x, y)).
Which of the functions in this command can help them determine how strongly related their variables are?
[expand title=View Answer] cor(x,y) [/expand]
Q3. Fill in the blank: The bias function compares the actual outcome of the data with the _____ outcome to determine whether or not the model is biased.
[expand title=View Answer] predicted[/expand]
Data Analysis with R Programming Weekly Challenge 3 Answers
Q1. A data analyst is creating a new data frame. Their dataset has dates, currency, and text strings. What characteristic of data frames is this an instance of?
[expand title=View Answer] Data stored can be many different types [/expand]
Q2. A data analyst is considering using tibbles instead of basic data frames. What are some of the limitations of tibbles? Select all that apply.
[expand title=View Answer]
1.Tibbles can never create row names
2.Tibbles won’t automatically change the names of variables
3.Tibbles can never change the input type of the data
[/expand]
Q3. 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?
[expand title=View Answer] colnames() [/expand]
Q4. A data analyst is working with the ToothGrowth dataset in R. What code chunk will allow them to get a quick summary of the dataset?
[expand title=View Answer]
1.glimpse(ToothGrowth)
2.min(ToothGrowth)
3.separate(ToothGrowth)
4.colnames(ToothGrowth)
[/expand]
Q5. A data analyst is working with the penguins dataset. What code chunk does the analyst write to make sure all the column names are unique and consistent and contain only letters, numbers, and underscores?
[expand title=View Answer]
1.drop_na(penguins)
2.clean_names(penguins)
3.rename(penguins)
4.select(penguins)
[/expand]
Q6. A data analyst is working with the penguins data. They write the following code:
penguins %>%
The variable species includes three penguin species: Adelie, Chinstrap, and Gentoo. What code chunk does the analyst add to create a data frame that only includes the Gentoo species?
[expand title=View Answer]
1.filter(Gentoo == species)
2.filter(species <- "Gentoo")
3.filter(species == "Gentoo")
4.filter(species == "Adelie")
[/expand]
Q7. A data analyst is working with the penguin’s dataset. They write the following code:
penguins %>%
group_by(species) %>%
What code chunk does the analyst add to find the mean value for the variable body_mass_g?
[expand title=View Answer]
1.summarize(=body_mass_g)
2.summarize(max(body_mass_g))
3.summarize(mean(body_mass_g))
4.summarize(body_mass_g(mean))
[/expand]
Q8. A data analyst is working with a data frame named salary_data. They want to create a new column named wages that includes data from the rate column multiplied by 40. What code chunk lets the analyst create the wages column?
[expand title=View Answer]
1.mutate(salary_data, rate = wages * 40)
2.mutate(wages = rate * 40)
3.mutate(salary_data, wages = rate * 40)
4.mutate(salary_data, wages = rate + 40)
[/expand]
Q9. A data analyst is working with a data frame named customers. It has separate columns for area code (area_code) and phone number (phone_num). The analyst wants to combine the two columns into a single column called phone_number, with the area code and phone number separated by a hyphen. What code chunk lets the analyst create the phone_number column?
[expand title=View Answer]
1.unite(customers, area_code, phone_num, sep=”-“)
2.unite(customers, “phone_number”, area_code, phone_num)
3.unite(customers, “phone_number”, area_code, sep=”-“)
4.unite(customers, “phone_number”, area_code, phone_num, sep=”-“)
[/expand]
Q10. A data analyst wants to summarize their data with the sd(), cor(), and mean(). What kind of measures are these?
[expand title=View Answer] Statistical[/expand]
Q11. In R, which statistical measure demonstrates how strong the relationship is between two variables?
[expand title=View Answer]Correlation [/expand]
Q12. A data analyst is studying weather data. They write the following code chunk:
bias(actual_temp, predicted_temp)
What will this code chunk calculate?
[expand title=View Answer]
1.The minimum difference between the actual and predicted values
2.The maximum difference between the actual and predicted values
3.The average difference between the actual and predicted values
4.The total average of the values
[/expand]
Week 04: Data Analysis with R Programming Coursera Quiz Answers
Test your knowledge of data visualizations in R
Q1. In ggplot2, you can use the _____ function to specify the data frame to use for your plot.
[expand title=View Answer] ggplot() [/expand]
Q2. In ggplot2, you use the plus sign (+) to add a layer to your plot.
[expand title=View Answer]True [/expand]
Q3. In ggplot2, what function do you use to map variables in your data to visual features of your plot?
[expand title=View Answer] The aes() function[/expand]
Q4. What type of plot will the following code create?
[expand title=View Answer] Scatterplot [/expand]
ggplot(data = penguins) +
geom_point(mapping = aes(x = flipper_length_mm, y = body_mass_g))
Test your knowledge of aesthetics in analysis
Q1. Which of the following aesthetic attributes can you map to the data in a scatterplot? Select all that apply.
[expand title=View Answer]
1.Color
2.Size
3.Shape
[/expand]
Q2. Which of the following functions lets you display smaller groups, or subsets, of your data?
[expand title=View Answer] facet_wrap() [/expand]
Q3. You can use the color aesthetic to add color to the outline of each bar in a bar chart.
[expand title=View Answer] True [/expand]
Q4. What is the role of the x argument in the following code?
[expand title=View Answer] An aesthetic[/expand]
ggplot(data = diamonds) +
geom_bar(mapping = aes(x = cut))
Q5. A data analyst creates a scatterplot with a lot of data points. It is difficult for the analyst to distinguish the individual points on the plot because they overlap. What function could the analyst use to make the points easier to find?
[expand title=View Answer]geom_jitter() [/expand]
Test your knowledge of annotating and saving visualizations
Q1. Which of the following are the benefits of adding labels and annotations to your plot? Select all that apply.
[expand title=View Answer]
1.Indicating the main purpose of your plot
2.Helping stakeholders quickly understand your plot
3.Highlighting important data in your plot
[/expand]
Q2. A data analyst is creating a plot for a presentation to stakeholders. The analyst wants to add a title, subtitle, and caption to the plot to help communicate important information. What function could the analyst use?
[expand title=View Answer] The labs() function[/expand]
Q3. What function can you use to put a text label inside the grid of your plot to call out specific data points?
[expand title=View Answer]The annotate() function [/expand]
Q4. A data analyst wants to add the title “Penguins” to a plot that visualizes the penguins dataset. What is the correct syntax for the argument of the labs() function?
[expand title=View Answer]
1.labs(title <- “Penguins”))
2.labs(title = “Penguins”)
3.labs("Penguins")
4.labs("Penguins" = title)
[/expand]
Q5. Which of the following functions can you use to save your plots in ggplot2?
[expand title=View Answer] The ggsave() function [/expand]
Data Analysis with R Programming Weekly Challenge 4 Answers
Q1. Which of the following are the benefits of using ggplot2? Select all that apply.
[expand title=View Answer]
1.Easily add layers to your plot
2.Combine data manipulation and visualization
3.Customize the look and feel of your plot
[/expand]
Q2. In ggplot2, what symbol do you use to add layers to your plot?
[expand title=View Answer] The plus sign (+)[/expand]
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.
[expand title=View Answer]
1.body_mass_g
2.x
3.flipper_length_mm
4.y
[/expand]
Q4. A data analyst uses the aes() function to define the connection between their data and the plots in their visualization. What argument is used to refer to matching up a specific variable in your data set with a specific aesthetic?
[expand title=View Answer]Mapping [/expand]
Q5. A data analyst is working with the penguin’s data. The analyst creates a scatterplot with the following code:
ggplot(data = penguins) +
geom_point(mapping = aes(x = flipper_length_mm, y = body_mass_g,alpha = species))
What does the alpha aesthetic do to the appearance of the points on the plot?
[expand title=View Answer]Makes some points on the plot more transparent [/expand]
Q6. You are working with the penguin’s dataset. You create a scatterplot with the following code chunk:
ggplot(data = penguins) +
geom_point(mapping = aes(x = flipper_length_mm, y = body_mass_g))
How do you change the second line of code to map the aesthetic size to the variable species?
[expand title=View Answer]
1.geom_point(mapping = aes(x = flipper_length_mm, y = body_mass_g, species = size)
2.geom_point(mapping = aes(x = flipper_length_mm, y = body_mass_g, size = species))
3.geom_point(mapping = aes(x = flipper_length_mm, y = body_mass_g, species + size)
4.geom_point(mapping = aes(x = flipper_length_mm, y = body_mass_g, size + species))
[/expand]
Q7. Fill in the blank: The _____ creates a scatterplot and then adds a small amount of random noise to each point in the plot to make the points easier to find.
[expand title=View Answer]geom_jitter() function[/expand]
Q8. You have created a plot based on data in the diamonds dataset. What code chunk can be added to your existing plot to create wrap-around facets based on the variable color?
[expand title=View Answer]
1.facet_wrap(~color)
2.facet_wrap(color)
3.facet_wrap(color~)
4.facet(~color)
[/expand]
Q9. A data analyst uses the annotate() function to create a text label for a plot. Which attributes of the text can the analyst change by adding code to the argument of the annotate() function? Select all that apply.
[expand title=View Answer]
1.Change the size of the text
2.Change the font style of the text
3.Change the color of the text
[/expand]
Q10. You are working with the penguin’s 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 JPEG file with “penguins” as the file name?
[expand title=View Answer]
1.ggsave(penguins)
2.ggsave(“penguins.jpeg”)
3.ggsave(penguins.jpeg)
4.ggsave(“jpeg.penguins”)
[/expand]
Week 05: Data Analysis with R Programming Coursera Quiz Answers
Test your knowledge of documentation and reports
Q1. R Markdown allows you to create a record of the steps you took to complete your analysis directly in RStudio.
[expand title=View Answer] True[/expand]
Q2. Fill in the blank: Markdown is a _____ for formatting plain text files.
[expand title=View Answer] syntax[/expand]
Q3. 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?
[expand title=View Answer] An R notebook[/expand]
Q4. A data analyst wants to convert their R Markdown file into another format. What are their options? Select all that apply.
[expand title=View Answer]
1.HTML, PDF, and Word
2.Slide presentation
3.Dashboard
[/expand]
Q5. A data analyst has finished editing their R Markdown file and wants to save it as an HTML report. What tool will they use?
[expand title=View Answer] Knit[/expand]
Test your knowledge about creating R Markdown documents
Q1. What information does a data analyst usually find in the header section of an RMarkdown document? Select all that apply.
[expand title=View Answer]
1.Title and author
2.File type
3.Date
[/expand]
Q2. While formatting their R Markdown document, a data analyst decides to make one of the headers smaller. What do they type into the document to do this?
[expand title=View Answer]Hashtags [/expand]
Q3. Inline code can be inserted directly into a .rmd file.
[expand title=View Answer] True[/expand]
Q4. To create bullet points to their output document, a data analyst adds _____ to their RMarkdown document.
[expand title=View Answer] asterisks[/expand]
Q5. A data analyst wants to embed a link in their RMarkdown document. They write (click here!)(www.rstudio.com) but it doesn’t work. What should they write instead?
[expand title=View Answer]
1.[click here!](www.rstudio.com)
2.
3.”click here!”(www.rstudio.com)
4.click here!(www.rstudio.com)
[/expand]
Test your knowledge of code chunks
Q1. A data analyst includes a section of code in their RMarkdown file so they can add comments and allow stakeholders to run it. What is the term for this section of code?
[expand title=View Answer] Code chunk [/expand]
Q2. Fill in the blank: A delimiter is a character that marks the beginning and end of _____.
[expand title=View Answer] a data item [/expand]
Q3. Data analysts put three backticks at the end of their code chunks to act as a delimiter.
[expand title=View Answer] True [/expand]
Q4. A data analyst has to create a monthly report for their stakeholders. What can they create to help them save time generating these reports?
[expand title=View Answer] Template[/expand]
Q5. A data analyst wants to mark the beginning of their code chunk. What delimiter should they type in their .rmd file?
[expand title=View Answer]
1.+++{r }
2.“`{r }
3.==={r }
4.***{r }
[/expand]
Data Analysis with R Programming Weekly Challenge 5 Answers
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?
[expand title=View Answer] R Markdown [/expand]
Q2. Fill in the blank: R Markdown notebooks can be converted into HTML, PDF, and Word documents, slide presentations, and _____.
[expand title=View Answer]dashboards [/expand]
Q3. A data analyst notices that their header is much smaller than they wanted it to be. What happened?
[expand title=View Answer]They have too many hashtags [/expand]
Q4. 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?
[expand title=View Answer] Inline code [/expand]
Q5. What symbol can be used to add bullet points in R Markdown?
[expand title=View Answer] Asterisks[/expand]
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?
[expand title=View Answer] Code chunk [/expand]
Q7. 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?
[expand title=View Answer] Delimiters[/expand]
Q8. 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.
[expand title=View Answer] a template [/expand]
Conclusion:
Completing the Data Analysis with R Programming Coursera quiz is a significant step toward mastering data analysis using R. These answers provide valuable insights and solutions to help you excel in your course and deepen your understanding of data analysis techniques.
This Quiz is a part of the Google Data Analytics Professional Certificate >>
Ask Questions to Make Data-Driven Decisions Quiz Answers
Foundations: Data, Data, Everywhere Quiz Answers
Prepare Data for Exploration Coursera Quiz Answers
Analyze Data to Answer Questions Coursera Quiz Answers