oc_forward(), oc_reverse(), and their data frame counterparts throw errors with NA in placename, latitude, or longitude.
oc_forward() error is due to oc_process(): Error in map_lgl(.x, .p, ...) : object 'query' not found
oc_reverse() error is due to oc_check_query(): Error in if (!(dplyr::between(longitude, -180, 180))) { : missing value where TRUE/FALSE needed
I think that an NA in any of the query arguments should just return an NA. When return is one of the list options, it can just be NA. If return = "df_list" it can be tibble::tibble(query = NA). This can be done in oc_process() and returned before query sent to opencage.
Fixes
[x] oc_forward() error with placename = NA
[x] oc_reverse() error with latitude = NA or longitude = NA
oc_forward()
,oc_reverse()
, and their data frame counterparts throw errors withNA
inplacename
,latitude
, orlongitude
.oc_forward()
error is due tooc_process()
:Error in map_lgl(.x, .p, ...) : object 'query' not found
oc_reverse()
error is due tooc_check_query()
:Error in if (!(dplyr::between(longitude, -180, 180))) { : missing value where TRUE/FALSE needed
I think that an
NA
in any of the query arguments should just return anNA
. Whenreturn
is one of the list options, it can just beNA
. Ifreturn = "df_list"
it can betibble::tibble(query = NA)
. This can be done inoc_process()
and returned before query sent to opencage.Fixes
[x]
oc_forward()
error withplacename = NA
[x]
oc_reverse()
error withlatitude = NA
orlongitude = NA