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 18 years old.
Using df, create a jittered strip plot where the data is grouped by embark_town and by age.
THE TEMPLATE THAT MUST BE FILLED IN TO GET THE SAME OUTPUT IS THE FOLLOWING ONE
# loads the RColorBrewer library
library(RColorBrewer)
titanic - # load the titanic.csv dataset
df - # subset titanic to include male passengers in first class over 18 years old
# set user-defined random seed
rand - as.integer(x = readLines(con = "stdin", n =1, warn=FALSE))
set.seed(rand)
# print random six row sample of df
df[sample(nrow(df),6),]
png(file="titanic_strip.png")
# create a jittered strip plot with embark_town along the x-axis, labeled "Embarkation town", and age along the
# y-axis, labeled "Age". Label the graph "Ages of first-class adult males on the Titanic by point of embarkation"
Write a program that loads and subsets the

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 Programming Questions!