Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to download just a few rows? #6

Closed
ismayc opened this issue May 1, 2020 · 3 comments
Closed

Possible to download just a few rows? #6

ismayc opened this issue May 1, 2020 · 3 comments

Comments

@ismayc
Copy link

ismayc commented May 1, 2020

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.

@simonpcouch
Copy link
Owner

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()!

@ismayc
Copy link
Author

ismayc commented May 1, 2020

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

@simonpcouch
Copy link
Owner

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!🦆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants