simonpcouch / anyflights

An R package to generate `nycflights13`-like air travel data🛩️

Home Page:https://simonpcouch.github.io/anyflights/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possible to download just a few rows?

ismayc opened this issue · comments

I admit I haven't looked into the code of this package much, but I was curious if there is a way to download just a few rows of the data instead of all of the data. As a use case, I'm trying to explore all flights leaving usually commercially designated airports in Oregon, but I don't really want to try out lots of options here and devote the time needed for all the downloads. I'd like just a head() of what's available.

Hi @ismayc! Feeling like this tweet might be relevant as well (re: workflows to make downloading data for many stations more bearable.)

Generally, as for downloading data for a lot of different airports, the flights data is currently downloaded in .zips month by month for all stations, and then the station argument is used to filter out relevant airports. I wrote to Hannes: "Try supplying station = get_airports()$faa rather than applying over many anyflights calls." Some of the other metadata in a get_airports() dataset might be helpful for filtering down to just Oregon airports, though?

As for just downloading a few rows, I'm not sure I have any recommendations for now. Performance-wise, get_flights is definitely the bottleneck in anyflights, so I think a main focus looking forward is to try to figure out if there's any way to download only the relevant data (as is the case with the weather data) in get_flights, if possible.

For now, I've updated documentation to be more explicit about how data is downloaded and recommendations for downloading larger amounts of data. Will leave open until I can spend more time poking around the API behind get_flights()!

Thanks much! That’s very informative on what’s going on behind the scenes. Feel free to close this if you like.

Just spent a bit more time with the flights API, and I'm not sure there's any functionality to download data in chunks smaller than one month for all airports. That said, I'm very much a novice with... web stuff. More thoughts here are very much welcome. :-)

Closing for now!🦆