However I notice that the weather_historyfunction throws errors when passing direct coordinates as location,
Documentation states:
The location for which data will be retrieved. Supplied as either a c(latitude,longitude) WGS84 coordinate pair or a place name string (with co-ordinates obtained via geocode()).
When I try to pass coordinates as a string or sf obect, I get errors, as it only accepts geocodable placenames. tHis sems to be the expectation in the function.
This seems to be the basic behavior of the query function. So I will need to find a workaround...
Reprex:
df_test<-data.frame(
location="Imeko Afon",
x=2.86779009861854,
y=7.59015267502207
)
df_coord <- st_as_sf(df_test, coords = c(2:3))
test<-"c(2.86779009861854,7.59015267502207)"
weather_history(
location=df_test$location[1],
start="2020-01-01",
end="2021-01-01",
daily = "precipitation_sum"
)
**Error in .coords_generic(location) :
location not provided as co-ordinate pair or string**
weather_history(
location=test,
start="2020-01-01",
end="2021-01-01",
daily = "precipitation_sum"
)
**Error in geocode(x, silent = FALSE) : No matches found**
Nice package and service!
However I notice that the
weather_history
function throws errors when passing direct coordinates as location,Documentation states:
When I try to pass coordinates as a string or sf obect, I get errors, as it only accepts geocodable placenames. tHis sems to be the expectation in the function.
This seems to be the basic behavior of the query function. So I will need to find a workaround...
Reprex: