Categories: Homework on time

Harvard Business School Rstudio Programming Questions 1.Data clean up: Remove duplicates by keeping the distinct combinations of the variables state, name

Harvard Business School Rstudio Programming Questions 1.Data clean up:

Remove duplicates by keeping the distinct combinations of the variables state, name, county, overall, mmr, lat, lng, and enroll.
Filter out schools outside the continent (use lng < 0). Use filtering to keep observations where mmr >= 0 or overall >= 0.
Using the function ifelse(), create a new variable rate where the value is equal to the value of mmr when mmr >= 0 is true and equal to overall when mmr >= 0 is false.
Save this data as measles_ne

Don't use plagiarized sources. Get Your Custom Essay on
Harvard Business School Rstudio Programming Questions 1.Data clean up: Remove duplicates by keeping the distinct combinations of the variables state, name
Just from $13/Page
Order Essay

2.Load the county map data using the function map_data() and save as us_counties

3.Additional data cleaning and data joining:

Begin with the measle_one data created in question 3.
Use the function str_to_lower() from the stringr package, to create a variable subregion that is the lowercase version of county.
Use the function str_to_lower() from the stringr package, to create a variable region that is the lowercase version of state.
For each region – subregion pair, use summarise() to calculate the mean of the variable rate.
Create a new variable threshold that is TRUE when rate > 0 and FALSE otherwise.
Use full_join() to join in the us_counties data by region and subregion.
Save this data as measles_two

4.Draw a map of the us counties and map the variable threshold to fill. Set the outline of the counties to the color “#f4f4f8” and a size of 0.1. Apply the palette “Dark2” from RColorBrewer, name the scale “Rate > 95%”, and set an na.value of “grey80”. Apply the theme theme_minimal().

5.Use geom_polygon()to draw a map of the counties (don’t use the measles_one data yet). Apply the following parameters (outside of aes()): fill = “#f5f5f2”, color = “black”, and size = 0.1. Save this plot as plot1 and print.

I have attach all the question below in R format.

superadmin

Share
Published by
superadmin

Recent Posts

Consider the following information, and answer the question below. China and England are internation

Consider the following information, and answer the question below. China and England are international trade…

4 years ago

The CPA is involved in many aspects of accounting and business. Let’s discuss some other tasks, othe

The CPA is involved in many aspects of accounting and business. Let's discuss some other…

4 years ago

For your initial post, share your earliest memory of a laser. Compare and contrast your first percep

For your initial post, share your earliest memory of a laser. Compare and contrast your…

4 years ago

2. The Ajax Co. just decided to save $1,500 a month for the next five years as a safety net for rece

2. The Ajax Co. just decided to save $1,500 a month for the next five…

4 years ago

How to make an insertion sort to sort an array of c strings using the following algorithm: * beg, *

How to make an insertion sort to sort an array of c strings using the…

4 years ago

Assume the following Keynesian income-expenditure two-sector model:

Assume the following Keynesian income-expenditure two-sector model:                                                AD = Cp + Ip                                                Cp = Co…

4 years ago