# this is my lat long dataframe.
test<-structure(list(Site = "Inlet at Mouth", Lat = 42.754942, Long = -76.463351), row.names = 1L, class = "data.frame")
# list of possible stations. I know this is optional but tried it anyway to see if it would get rid of error.
station_data = ghcnd_stations()
# find closest stations
mon_near_pw <-
meteo_nearby_stations(
lat_lon_df = test,
lat_colname = "Lat",
lon_colname = "Long",
station_data = station_data,
var = "PRCP",
year_min = 2011,
year_max = 2015,
radius = 100,
)
and I am getting the following generic error:
Error in `$<-.data.frame`(`*tmp*`, "id", value = character(0)) :
replacement has 0 rows, data has 1
The example workflow (https://stackoverflow.com/questions/68878571/how-to-download-precipitation-data-using-rnoaa) works for me but when using my own site I get this error and I don't know why. The class of the lat long columns are numeric. Could it be that there is no data for my location for the time parameters I chose? If this is the case, I still wouldn't expect this error.
I am using
meteo_nearby_stations
like so:and I am getting the following generic error:
The example workflow (https://stackoverflow.com/questions/68878571/how-to-download-precipitation-data-using-rnoaa) works for me but when using my own site I get this error and I don't know why. The class of the lat long columns are numeric. Could it be that there is no data for my location for the time parameters I chose? If this is the case, I still wouldn't expect this error.
Any help is much appreciated. Thank you.
Session info: