Course 7: Data Analysis with R Programming, all weekly challenge quiz answers of this course are provided in this article from week 1 to week 5 to help students solving this exam.

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?
- Syntax
language
- Function
language
- Programming
language
- Coded
language
Q2. Many data analysts prefer to use a programming language
for which of the following reasons? Select all that apply.
- To
choose a topic for analysis
- To
easily reproduce and share an analysis
- To
clarify the steps of an analysis
- To
save time
Q3. Which of the following are benefits of open-source code?
Select all that apply.
- Anyone
can fix bugs in the code
- Anyone
can create an add-on package for the code
- Anyone
can pay a fee for access to the code
- Anyone
can use the code for free
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.
- the
R programming language
- a
dashboard
- a
spreadsheet
- structured
query language
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?
- Structured
query language
- A
slide presentation
- A
dashboard
- R
programming language
Q6. RStudio’s integrated development environment lets you
perform which of the following actions? Select all that apply.
- Install
R packages
- Create
data visualizations
- Import
data from spreadsheets
- Stream
online videos
Q7. In which two parts of RStudio can you execute code?
Select all that apply.
- The
environment pane
- The
plots pane
- The
source editor pane
- The
R console pane
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.
- environment
pane
- plots
pane
- R
console pane
- source
editor pane
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?
- print("peaches")
- weekly_sales
<- 7450
- #filter
- mass
> 1000
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?
- _2020sales
- sales_2020
- -sales-2020
- 2020_sales
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?
- v(12,
23, 51)
- c(12,
23, 51)
- c(51,
23, 12)
- v(51,
23, 12)
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?
- mdy()
- now()
- datetime()
- lubridate()
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.
- Assignment
- Arithmetic
- Logical
- Relational
Q6. 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.
- Use
single letters, such as “x” to name all variables
- Use
an underscore to separate words within a variable name
- Use
all lowercase letters in variable names
- Begin
all variable names with an underscore
Q7. Which of the following are included in R packages?
Select all that apply.
- Tests
for checking your code
- Sample
datasets
- Reusable
R functions
- Naming
conventions for R variable names
Q8. Packages installed in RStudio are called from CRAN. CRAN
is an online archive with R packages and other R-related resources.
- True
- False
Q9. When programming in R, what is a pipe used as an
alternative for?
- Variable
- Vector
- Nested
function
- Installed
package
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?
- Data
stored can be many different types
- Columns
should contain the same number of items
- Columns
should be named
- Variables
should be named
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.
- Tibbles
can overload a console
- Tibbles
can never create row names
- Tibbles
won’t automatically change the names of variables
- Tibbles
can never change the input type of the data
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?
- colnames()
- head()
- str()
- mutate()
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?
- glimpse(ToothGrowth)
- min(ToothGrowth)
- separate(ToothGrowth)
- colnames(ToothGrowth)
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?
- drop_na(penguins)
- clean_names(penguins)
- rename(penguins)
- select(penguins)
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?
- filter(Gentoo
== species)
- filter(species
<- "Gentoo")
- filter(species
== "Gentoo")
- filter(species
== "Adelie")
Q7. A data analyst is working with the penguins 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?
- summarize(=body_mass_g)
- summarize(max(body_mass_g))
- summarize(mean(body_mass_g))
- summarize(body_mass_g(mean))
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?
- mutate(salary_data,
rate = wages * 40)
- mutate(wages
= rate * 40)
- mutate(salary_data,
wages = rate * 40)
- mutate(salary_data,
wages = rate + 40)
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?
- unite(customers,
area_code, phone_num, sep="-")
- unite(customers,
"phone_number", area_code, phone_num)
- unite(customers,
"phone_number", area_code, sep="-")
- unite(customers,
"phone_number", area_code, phone_num, sep="-")
Q10. A data analyst wants to summarize their data with the
sd(), cor(), and mean(). What kind of measures are these?
- Statistical
- Numerical
- Summary
- Standard
Q11. In R, which statistical measure demonstrates how strong
the relationship is between two variables?
- Standard
deviation
- Correlation
- Average
- Maximum
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?
- The
minimum difference between the actual and predicted values
- The
maximum difference between the actual and predicted values
- The
average difference between the actual and predicted values
- The
total average of the values
Data Analysis with R Programming Weekly Challenge 4 Answers
Q1. Which of the following are benefits of using ggplot2?
Select all that apply.
- Automatically
clean data before creating a plot
- Easily
add layers to your plot
- Combine
data manipulation and visualization
- Customize
the look and feel of your plot
Q2. In ggplot2, what symbol do you use to add layers to your
plot?
- The
equal sign (=)
- The
ampersand symbol (&)
- The
pipe operator (%>%)
- The
plus sign (+)
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.
- body_mass_g
- x
- flipper_length_mm
- y
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?
- Faceting
- Mapping
- Jittering
- Annotating
Q5. A data analyst is working with the penguins 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?
- Makes
some points on the plot more transparent
- Makes
the points on the plot more colorful
- Makes
the points on the plot smaller
- Makes
the points on the plot larger
Q6. You are working with the penguins 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?
- geom_point(mapping
= aes(x = flipper_length_mm, y = body_mass_g, species = size)
- geom_point(mapping
= aes(x = flipper_length_mm, y = body_mass_g, size = species))
- geom_point(mapping
= aes(x = flipper_length_mm, y = body_mass_g, species + size)
- geom_point(mapping
= aes(x = flipper_length_mm, y = body_mass_g, size + species))
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.
- geom_bar()
function
- geom_jitter()
function
- geom_smooth()
function
- geom_point()
function
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?
- facet_wrap(~color)
- facet_wrap(color)
- facet_wrap(color~)
- facet(~color)
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.
- Change
the size of the text
- Change
the font style of the text
- Change
the color of the text
- Change
the text into a title for the plot
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 jpeg file with “penguins” as the file name?
- ggsave(penguins)
- ggsave("penguins.jpeg")
- ggsave(penguins.jpeg)
- ggsave("jpeg.penguins")
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?
- Code
chunks
- Filters
- Dashboards
- R
Markdown
Q2. Fill in the blank: R Markdown notebooks can be converted
into HTML, PDF, and Word documents, slide presentations, and _____.
- dashboards
- spreadsheets
- tables
- YAML
Q3. A data analyst notices that their header is much smaller
than they wanted it to be. What happened?
- They
have too few hashtags
- They
have too few asterisks
- They
have too many hashtags
- They
have too many asterisks
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?
- Inline
code
- YAML
- Documented
- Markdown
Q5. What symbol can be used to add bullet points in R
Markdown?
- Backticks
- Asterisks
- Brackets
- Exclamation
marks
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?
- Data
plot
- YAML
- Documentation
- Code
chunk
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?
- Hashtags
- Delimiters
- Asterisks
- Markdown
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.
- a
filter
- a
template
- an
.rmd file
- a code chunk
Post a Comment