Skip to content

Commit

Permalink
This was worse than expected tidyverse#54
Browse files Browse the repository at this point in the history
There was something keeping me up with the other commit. Row counts didn't match.

I did my best but the current data is too different to the original and I don't have access to the original source files. In the new version, there are four tail numbers that no longer exist in `planes`.  However, there are now 38 more tail numbers in `planes` and 1213 more `flights` that have a tail number with an associated plane.
  • Loading branch information
guslipkin committed Oct 21, 2022
1 parent 13b66a1 commit 118f559
Show file tree
Hide file tree
Showing 3 changed files with 3,367 additions and 2,680 deletions.
12 changes: 7 additions & 5 deletions data-raw/planes.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ library(readr)

# Update URL from
# http://www.faa.gov/licenses_certificates/aircraft_certification/aircraft_registry/releasable_aircraft_download/
src <- "https://registry.faa.gov/database/ReleasableAircraft.zip"
src <- "https://registry.faa.gov/database/yearly/ReleasableAircraft.2013.zip"
lcl <- "data-raw/planes"

if (!file.exists(lcl)) {
Expand All @@ -15,17 +15,19 @@ if (!file.exists(lcl)) {
}

master <- read.csv("data-raw/planes/MASTER.txt", stringsAsFactors = FALSE, strip.white = TRUE)
names(master) <- tolower(names(master))

keep <- master %>%
as_tibble() %>%
select(nnum = n.number, code = mfr.mdl.code, year = year.mfr)
select("nnum" = 1, "code" = 3, "year" = 5)

ref <- read.csv("data-raw/planes//ACFTREF.txt",
ref <- read.csv("data-raw/planes/AcftRef.txt",
stringsAsFactors = FALSE,
strip.white = TRUE
)
names(ref) <- tolower(names(ref))
names(ref) <-
c("mfr", "model", "type.acft", "type.eng", "ac.category",
"amat.tc.built", "no.eng", "no.seats", "ac.weight", "speed", "code",
"kit.code", "extra")

ref <- ref %>%
as_tibble() %>%
Expand Down
Loading

0 comments on commit 118f559

Please sign in to comment.