Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use R to answer the following questions, What is the *proportion* of counties in each state that has had zero deaths? In other words:

Please use R to answer the following questions,

  1. 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`. Note: work through it in steps.
  2. 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`.

data source:

https://github.com/nytimes/covid-19-data/

Please load (us-counties.csv) data set from above website and create data frame

or

county_df <- read.csv("https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-counties.csv")

county_df <- unite(county_df, col="county_state", county, state, sep=",", remove = FALSE) # create new column that store a string of the county and state names together

`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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intermediate Algebra With Trigonometry

Authors: Charles P McKeague

1st Edition

1483218759, 9781483218755

More Books

Students also viewed these Mathematics questions

Question

Types of cultural maps ?

Answered: 1 week ago

Question

Discuss the various types of leasing.

Answered: 1 week ago

Question

Define the term "Leasing"

Answered: 1 week ago

Question

What do you mean by Dividend ?

Answered: 1 week ago

Question

1. Describe the types of power that effective leaders employ

Answered: 1 week ago