Menu

[Solved]-Two Parts Lab Part 1 5 Points Follow Complete Steps Outline Video Lecture 53 Please Make S Q37165996

There are two parts to this lab. Part 1: (5 points) Follow andcomplete the steps outline in video lecture 53. Please make sure tosubmit your two screenshots (Plot for 1960 and 2013), together withyour R code. No grade will be awarded without the screenshots.

Part 2: (5 points) Compare the dataframe generated from Part 1for 2013 only (“merged2013″, of about 187 rows) to the dataframeused as part of our lecture (name of the dataframe is call”merged”, of about 195 rows), the number of countries in both datado not match up. In fact, there is a difference of about 8countries. Use R to create a dataframe where you are listing outwhich 8 countries are missing from the “merged” dataframe ascompare with “merged2013”. You have to show the R code, as well asscreenshot of the result. You are welcome to use any researched Rfunction to achieve the task. Hint: Focus on the country code inboth dataframes.

No grade will be awarded if you did not use R or missingscreenshot.

Part 1: The underscore is where I have to edit the code. Thedataset for the project is inhttps://www.superdatascience.com/pages/rcourse

#Set the Working Directory
getwd()
setwd(“_”)
getwd()

#Import the csv dataset
data <- _(“Section5-Homework-Data.csv”)

#Explore the data
data
_(data) #check top 6 rows
_(data, _=7) #check bottom 7 rows
_(data) #check the structure of the data frame
_(data) #check the summary of the data

#Did you pick up that there is more than one year in thedata?
#From the challenge we know that there are two: 1960 and 2013

#Filter the dataframes
data1960 <- data[data$_==1960,]
data2013 <- z

#Check row counts
_(data1960) #187 rows
_(data2013) #187 rows. Equal split.

#Create the additional dataframes
add1960 <- _(Code=_, Life.Exp=_)
add2013 <- _(_=_, _=_)

#Check summaries
_(add1960)
_(add2013)

#Merge the pairs of dataframes
merged1960 <- _(data1960, add1960, _=”Country.Code”,_=”Code”)
merged2013 <- _(_, _, _=_, _=_)

#Check the new structures
_(merged1960)
_(merged2013)

#We can see an obsolete column in each of the mergeddataframes
#Column “Year” is no longer required. Let’s remove it
merged1960$_ <- _
___ <- _

#Check structures again
_(merged1960)
_(merged2013)

#Visualization time
library(_)

#Visualize the 1960 dataset
_(_=merged1960, _=Fertility.Rate, _=Life.Exp,
_=Region, #colour
size=_(5),
_=_(0.6), #transparency
_=”Life Expectancy vs Fertility (1960)” #title
)

#Visualize the 2013 dataset
_

Expert Answer


Answer to There are two parts to this lab. Part 1: (5 points) Follow and complete the steps outline in video lecture 53. Please ma… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *