Skip to content

Commit

Permalink
Passed ellipsis to inner funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
jbedia committed Jul 20, 2017
1 parent 477428c commit f833bb8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Suggests:
loadeR,
Type: Package
Title: An R package for drought assessment fully integrated in the climate4R bundle
Version: 0.0.0
Date: 2017-07-18
Version: 0.0.1
Date: 2017-07-20
Authors@R: as.person(c(
"Santander Meteorology Group <http://meteo.unican.es> [ctb]",
"Joaquin Bedia <[email protected]> [aut, cre]",
Expand Down
11 changes: 8 additions & 3 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
drought4R 0.0.0
===============

v0.0.0
======
* First package release

v0.0.1
======
* Bug fix (forgot to pass the ellipsis to the inner functions)





4 changes: 2 additions & 2 deletions R/petGrid.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ petGrid <- function(tasmin = NULL,
...) {
method <- match.arg(method, choices = c("thornthwaite", "hargreaves"))
out <- switch(method,
"thornthwaite" = petGrid.th(tas),
"hargreaves" = petGrid.har(tasmin, tasmax, pr))
"thornthwaite" = petGrid.th(tas, ...),
"hargreaves" = petGrid.har(tasmin, tasmax, pr, ...))
## Recover the grid structure -----------------------
coords <- getCoordinates(out$ref.grid)
pet.grid <- out$ref.grid
Expand Down
6 changes: 3 additions & 3 deletions R/speiGrid.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
#' @examples
#' # By default, et0.grid is null, and SPI is computed from precipitation:
#' data("pr.cru.iberia")
#' spi3 <- speiGrid(pr.grid = pr.cru.iberia, scale = 3)
#' spi3 <- speiGrid(pr.grid = pr.cru.iberia, scale = 3, na.rm = TRUE)
#' ## If PET is used, then SPEI is calculated
#' data("tas.cru.iberia")
#' et0.grid <- petGrid(tas = tas.cru.iberia, method = "thornthwaite")
#' spei3 <- speiGrid(pr.cru.iberia, et0.grid = et0.grid, scale = 3)
#' spei3 <- speiGrid(pr.cru.iberia, et0.grid = et0.grid, scale = 3, na.rm = TRUE)

speiGrid <- function(pr.grid, et0.grid = NULL, scale = 3, ...) {
pr.grid <- redim(pr.grid, member = TRUE)
Expand All @@ -61,7 +61,7 @@ speiGrid <- function(pr.grid, et0.grid = NULL, scale = 3, ...) {
}
wbalance <- pr - pet
pt <- pet <- NULL
index <- spei(wbalance, scale, na.rm = TRUE) %>% extract2("fitted") %>% mat2Dto3Darray(x = coords$x, y = coords$y)
index <- spei(wbalance, scale, ...) %>% extract2("fitted") %>% mat2Dto3Darray(x = coords$x, y = coords$y)
})
message("[", Sys.time(), "] Done")
## Recover the grid structure -----------------------
Expand Down
4 changes: 2 additions & 2 deletions man/speiGrid.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f833bb8

Please sign in to comment.