Question: 1 . Load the midwest dataset from the ggplot 2 package. a . Use the filter function ( page 1 6 1 ) to select

1. Load the midwest dataset from the ggplot2 package.
a. Use the filter function (page 161) to select observations in Ohio.
i. What is the average percentage of college educated among these counties?
ii. What is the average percentage of Asians in Ohio?
b. Use the group_by function to obtain average percentage of college educated and
average percentage of Asians for all midwestern states.
2. Type the following code below into an Rscript file in order to create two data frames. Once
you have created the data frames do the following:
Using commands found in the Tidyverse package, perform the following joins
individually.
o Left Join
o Right Join
o Full Join
o Using comments in your script, explain the results of the output.
CODE TO CREATE DATA FRAMES
library(ggplot2)
data("economics")
econ2<- economics %>% select(-date)%>% map_if(is.integer, ~.x/1000)
DF1<- data.frame(wages1= rlnorm(100, meanlog = log(50000)), pension1=
rlnorm(100,meanlog = log(1e+05)), hhid =1:100)
DF2<- data.frame(wages2= rlnorm(100, meanlog = log(50000)), pension2=
rlnorm(100,meanlog = log(1e+05)), hhid =1:100)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!