Question
4 Data exploration and manipulation The task is to explore the US census population estimates by county for 2015 from the package usmap (load the
4 Data exploration and manipulation
The task is to explore the US census population estimates by county for 2015 from the package usmap (load the data frame from countypop.RData). The data frame has 3142 rows and 4 variables: fips is the 5-digit FIPS code corresponding to the county; abbr is the 2-letter state abbreviation; county is the full county name; pop_2015 is the 2015 population estimate (in number of people) for the corresponding county. Each row of the data frame represents a different county or a county equivalent. For the sake of simplicity, when we say a county, that also includes a county equivalent and when we say a state, that also includes the District of Columbia. Answer the following questions.
- Remove all the rows that contain at least one NA (1 point).
- How many unique 2-letter state abbreviations are there (1 point)?
- What is the total number of counties in the US (2 point)?
- How many unique county names are there (1 point)?
- What are the top 10 most common county names (1 point)?
- Which state has the largest number of counties? Which state has the smallest number of counties (1 point)?
- What is the average population of a county in the US (1 point)?
- Which state has the largest county in terms of population? How many people live in the largest county in terms of population (2 points)?
- What is the largest county in terms of population of each of the states (2 points)?
- What is the average population of the 100 largest counties in the US (2 points)?
- How many people live in each of the states (2 points)?
- What is the average population of a county in California (1 point)?
can you provide R code with dplyr function and without dplyr function? thank you.
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