Skip to content

Commit

Permalink
raster.kendall bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyevans committed Feb 29, 2024
1 parent bd0555d commit aa6c257
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/cgls_urls.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ cgls_urls <- function(dates = NULL, resolution = c(1000, 300),
}
if(!is.null(dates)){
file.url <- file.url[grep(paste(paste0(gsub("-", "", dates),"0000"),
collapse="|"), file.url)]
collapse=" | "), file.url)]
if(length(file.url) < 1)
stop("There are no data in this date range")
}
Expand Down
2 changes: 1 addition & 1 deletion R/raster.kendall.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ raster.kendall <- function(x, intercept = TRUE, p.value = TRUE,
idx <- which(c(TRUE, tau, intercept, p.value, rep(confidence,2)))
out.names <- c("slope", "tau", "intercept", "p-value", "limits.LCL", "limits.UCL")[idx]
trend.slope <- function(y, metrics=idx, method=method[1]) {
kendall(y)[metrics]
kendall(y, method = method, threshold = min.obs)[metrics]
}
k <- terra::app(x, fun=trend.slope, ...)
names(k) <- out.names
Expand Down

0 comments on commit aa6c257

Please sign in to comment.