Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please use R to write the following questions, What is the *proportion* of counties in each state that has had zero deaths? In other words:
Please use R to write the following questions,
- What is the *proportion* of counties in each state that has had zero deaths? In other words: in each state, how many counties have had 0 deaths (divided by the total number of counties in the state)? You should produce a *data frame* with columns `state` (containing the statename) and `proportion` (containing the ratio as a decimal), saving that data frame in a variable `proportion_no_deaths_df`.
- What proportion of counties in Washington state has had zero deaths? Use your `proportion_no_deaths` data frame, and save your result in `wa_prop_no_deaths`.
Notes:
data set source:
https://github.com/nytimes/covid-19-data/
Please read (us-counties.csv) data set above website and create data frame: "county_df" first
`tidyverse` package
Addition notes:
you can use the `group_by()` function to perform the same computation simultaneously across groups of rows. Your variables may need to include the specific column or value being asked for (use `pull()`).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started