The short answer on you question is quite simple: just replace as.Date
with the c()
function:
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)
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 code get_prism_dailys()
, which is possible with
print(get_prism_dailys)
The dates
argument is processed get_prism_dailys()
with the gen_dates()
function:
dates <- gen_dates(minDate = minDate, maxDate = maxDate, dates = dates)
In its turn, the gen_dates()
is transforming the dates argument with as.Dates()
, as we can find with getAnywhere():
getAnywhere(gen_dates)
if(!is.null(dates)){
# make sure it is cast as a date if it was provided as a character
dates <- as.Date(dates)
Thus, the transformation of the date
input with as.Date()
is not necessary, but it is essential to put all the supplied dates into a single vector.
Hope, it will be helpful :)