Trying to get mean temperature for a certain date over the last 5 years. Keep running into this same error. Any suggestions would be greatly appreciated!
get_prism_dailys(type="tmean", dates = as.Date("2018-06-01", "2017-06-01", "2016-06-01", "2015-06-01", "2014-06-01"), keepZip=FALSE)
Error Received:
Error in if (!is_within_daily_range(dates)) stop("Please ensure all dates fall within the valid Prism data record") : missing value where TRUE/FALSE needed
The short answer on you question is quite simple: just replace
as.Datewith thec()function:It seems to me that the third examples to
get_prism_dailys(), which you have probably used, has a small issue. Lets's see on the source codeget_prism_dailys(), which is possible withThe
datesargument is processedget_prism_dailys()with thegen_dates()function:In its turn, the
gen_dates()is transforming the dates argument withas.Dates(), as we can find with getAnywhere():Thus, the transformation of the
dateinput withas.Date()is not necessary, but it is essential to put all the supplied dates into a single vector.Hope, it will be helpful :)