Question: Write a program that loads and subsets the dataset in titanic.csv . Load the dataset in titanic.csv as titanic. Create a new data frame, df
Write a program that loads and subsets the dataset in titanic.csv
Load the dataset in titanic.csv as titanic.
Create a new data frame, df by subsetting the t it anic data frame to include instances with male first class passengers who are
over years old.
Using df create a jittered strip plot where the data is grouped by embarktown and by age.
THE TEMPLATE THAT MUST BE FILLED IN TO GET THE SAME OUTPUT IS THE FOLLOWING ONE
# loads the RColorBrewer library
libraryRColorBrewer
titanic # load the titanic.csv dataset
df # subset titanic to include male passengers in first class over years old
# set userdefined random seed
rand asintegerx readLinescon "stdin", n warnFALSE
set.seedrand
# print random six row sample of df
dfsamplenrowdf
pngfile"titanicstrip.png
# create a jittered strip plot with embarktown along the xaxis, labeled "Embarkation town", and age along the
# yaxis, labeled "Age". Label the graph "Ages of firstclass adult males on the Titanic by point of embarkation"
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
