ropensci / opencage

:globe_with_meridians: R package for the OpenCage API -- both forward and reverse geocoding :globe_with_meridians:
https://docs.ropensci.org/opencage
87 stars 11 forks source link

Feature request: append original query to results data frame? #21

Closed JakeRuss closed 7 years ago

JakeRuss commented 7 years ago

Hi @maelle,

I have about 2,200 European cities that I want to get coordinates for and I thought I'd try out your package as an alternative to ggmap. It works really well! However, one feature that ggmap offers that would be great to include here, would be to append the original location query to the results data frame. It would simplify the process of merging the coordinate data back to the original data frame.

freyfogle commented 7 years ago

Hi, that's exactly the purpose of the optional add_request parameter, see: https://geocoder.opencagedata.com/api#forward-opt

JakeRuss commented 7 years ago

Thank you for pointing that out @freyfogle. I don't see that API parameter supported in the opencage docs, so let me see if I can add that support and submit a quick pull request.

maelle commented 7 years ago

Good idea, thanks, feel free to submit a pull request, even better with an unit test 😊 if you do add yourself as ctb in DESCRIPTION .

maelle commented 7 years ago

I think I can close this now thanks to your work @JakeRuss ! :smile_cat: