Skip to content

Commit

Permalink
prep release
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Leutner committed Jan 7, 2019
1 parent c9f5259 commit d661c86
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
17 changes: 10 additions & 7 deletions R/rescaleImage.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,16 @@ rescaleImage <- function(x, y, xmin, xmax, ymin, ymax, forceMinMax = FALSE) {
if(missing("ymax")) ymax <- maxValue(y)
if(missing("xmin")) xmin <- minValue(x)
if(missing("xmax")) xmax <- maxValue(x)

li <- list(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax)
} else {
## X and Y are vectors
if(missing("xmin")) xmin <- min(x, na.rm = T)
if(missing("xmax")) xmax <- max(x, na.rm = T)
if(missing("xmin")) ymin <- min(y, na.rm = T)
if(missing("xmax")) ymax <- max(y, na.rm = T)
}

li <- list(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax)
if(inherits(x, "Raster")) {
li <- lapply(li, function(lim){
if(length(lim) == 1) {
return(rep(lim, nlayers(x)))
Expand All @@ -50,11 +58,6 @@ rescaleImage <- function(x, y, xmin, xmax, ymin, ymax, forceMinMax = FALSE) {
}
stop("xmin, xmax, ymin and ymax must be of length 1 or of length nlayers(x)", call. = FALSE)
})

} else {
li <- list()
if(missing("xmin")) li[["xmin"]] <- min(x, na.rm = T)
if(missing("xmax")) li[["xmax"]] <- max(x, na.rm = T)
}

norange <- li$xmax == li$xmin
Expand Down
6 changes: 2 additions & 4 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
* Reduces tests which run on CRAN (complies with email from CRAN/Ligges (18/06/2018))
Tests take now only about 120s to 150s on win_builder/R-devel.
* Complies with email from CRAN/Hornik (17/05/2018): removed superfluous/undeclared package dependency in unit tests (lattice)
* Adds compatibility with upcoming ggplot2 v2.3.0
Fixes functions/tests for current R-devel (Email from CRAN/Ripley, 4.1.19)

### R CMD checks
### Test environments
Expand All @@ -16,3 +13,4 @@ There were no ERRORs, WARNINGs or NOTEs.
moveVis OK


### Changelog:

0 comments on commit d661c86

Please sign in to comment.