if(require(hflights)) {
a <- preprocesshflights(hflights[1:10000,])
summary(a)
}
library(hflights)
## We create a file with no header
input <- "hflights.csv"
write.table(hflights,file=input,sep=",",
row.names=FALSE,col.names=FALSE)
## Inefficient way to read the data. Just as example
lines <- readLines(input)
lines <- gsub("\"","",lines,fixed=TRUE )
x <- strsplit(lines,",")
x <- as.data.frame(do.call("rbind",x))
x <- preprocesshflights(x)
summary(x)
Run the code above in your browser using DataCamp Workspace