Skip to content

Commit 0fac645

Browse files
committed
Fix bug where multiple years fail check in year range
1 parent 951fd2f commit 0fac645

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

R/get_chirts.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ get_chirts.SpatExtent <- function(object, dates, var, as.raster = TRUE, ...){
231231

232232
# year range
233233
yrange <- seq(1983, 2016, 1)
234-
if (unique(years) %notin% yrange) {
234+
if (any(unique(years) %notin% yrange)) {
235235
stop(call. = FALSE,
236236
"CHIRTS data is currently available from 1983 to 2016. ",
237237
"Soon available to near-present.")

chirps.Rproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Version: 1.0
2+
ProjectId: c21b96f2-cc6e-4f20-94ac-d2da6c626fe1
23

34
RestoreWorkspace: Default
45
SaveWorkspace: No

0 commit comments

Comments
 (0)