Closed jameshiebert closed 9 years ago
The get.date.field() utility function used by climdexInput.csv() is supposed to take a set of date component columns, paste them together and then use the pasted dates to construct the climdexInput object.
get.date.field()
climdexInput.csv()
However, there is a bug here https://github.com/pacificclimate/climdex.pcic/blob/master/R/climdex.r#L204 where if there is only one date field (e.g. a field that contains the full date in %Y-%m-%d format), R downgrades the return object to a vector and then do.call() fails.
do.call()
The solution is simply to add the drop=FALSE argument to the indexing as such:
date.strings <- do.call(paste, input.data[,date.type$fields,drop=FALSE])
The
get.date.field()
utility function used byclimdexInput.csv()
is supposed to take a set of date component columns, paste them together and then use the pasted dates to construct the climdexInput object.However, there is a bug here https://github.com/pacificclimate/climdex.pcic/blob/master/R/climdex.r#L204 where if there is only one date field (e.g. a field that contains the full date in %Y-%m-%d format), R downgrades the return object to a vector and then
do.call()
fails.The solution is simply to add the drop=FALSE argument to the indexing as such: