mutate_geocode() is incompatible with the behavior of tbl_df-type data frames #68
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If the data frame that is passed into
mutate_geocode()
happens to be a class oftbl_df
(via dplyr, an error will arise due totbl_df
's different subsetting behavior.Demonstration of error:
Error message:
I'm not sure of how often ggmap users will have a situation in which their data frames are actually tbl_dfs...all I know is that it happened to me on my very first spin of mutate_geocode :).
In the pull request I've made what I think fixes the issue without requiring the user to convert their tbl_df before running
mutate_geocode()
. I'm not sure if this works for all cases or introduces any other kind of breakage. Or if any of ggmap's other vector functions might need the same fix.mutate_geocode()
coerces the result into a data.frame...not sure if that should be changed in case a user is expecting tbl_df() back...