Question
2) a) Use data.table coding to read in the nyc data as was done in class. Assign the data table to the variable flights3 (The
2) a) Use data.table coding to read in the nyc data as was done in class. Assign the data table to the variable flights3 (The nycdata.csv is found on Canvas) b) Use data.table coding to modify flights3 so that only the column variables origin, dest, and carrier appear. c) Now use data.table coding that reflects an origin of JFK, a destination of SEA and a carrier of only Delta Airlines DL. d) Use data.table coding to remove the variable air time from the original flights3 data table. e) Use and show data.table coding to output the maximum and the minimum values for the variable distance.
My last line of code is returning an error. What am I missing?
library(data.table)
flights3 <- fread("nycdata.csv") flights3
flights4 <- flights3[, .(origin, dest, carrier)]
flights5 <-flights4[origin == "JFK" & dest == "SEA" & carrier == "DL"]
flights6<- flights3[, !c("air_time")]
nrow(flights3)
flights7 <- flights3[order(-dist)]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started