Closed dpprdan closed 6 years ago
Just pulled these changes and found a couple of issues. Using stringsAsFactor = FALSE
in the apply
chain turns all variables into characters, including lat and lng, which is not what we want. This is because unlist
turns the variables into a character vector. Thus, stringsAsFactor = FALSE
avoids the factor problem but numbers are turned into characters.
The other issue is that the change to use flatten = TRUE
in oc_parse
as discussed in issue #40 and proposed in PR #42 changes the structure of the list returned by oc_parse
, which breaks the lapply
chain.
My proposal is to use flatten = TRUE
in PR #42, remove the lapply
chain to create a data frame of results, and simply use the data frame of results created by flatten = TRUE
within the list output used by opencage_format
. This change should not be any more breaking than the current change to stringsAsFactor = FALSE
and would return a data frame that handles characters and numbers in a manner consistent with the API and the results from oc_forward
and oc_reverse
.
I think this is fixed now.
Thanks! 🎊
See https://github.com/ropensci/opencage/commit/ddac5dc7d31a6a0a563d80fa603cb4a2edf048c6#r27554681