Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

Students also viewed these Databases questions