From e0db69699bdd5848b6420876a3acf7464693d408 Mon Sep 17 00:00:00 2001 From: rhijmans Date: Mon, 2 Dec 2024 19:28:02 -0800 Subject: [PATCH] m --- R/geom.R | 5 ----- R/plot_let.R | 4 +++- R/sample.R | 5 ++++- man/plot.Rd | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/R/geom.R b/R/geom.R index 95fc2f055..54f96ab5d 100644 --- a/R/geom.R +++ b/R/geom.R @@ -714,11 +714,6 @@ setMethod("split", signature(x="SpatVector", f="SpatVector"), } values(f) <- NULL ex <- ext(x) - i <- intersect(ext(x), ext(f)) - if (is.null(i)) { - warn("split", "x and f do not intersect") - return(x) - } r <- relate(x, f, "intersects") if (sum(r) == 0) { warn("split", "x and f do not intersect") diff --git a/R/plot_let.R b/R/plot_let.R index 842b2bbf5..1e43e6c6a 100644 --- a/R/plot_let.R +++ b/R/plot_let.R @@ -466,7 +466,9 @@ make.panel <- function(x, maxcell) { setMethod("plet", signature(x="SpatRaster"), function(x, y=1, col, alpha=0.8, main=names(x), tiles=c("Streets", "Esri.WorldImagery", "OpenTopoMap"), - wrap=TRUE, maxcell=500000, stretch=NULL, legend="bottomright", shared=FALSE, panel=FALSE, collapse=TRUE, type=NULL, breaks=NULL, breakby="eqint", sort=TRUE, decreasing=FALSE, map=NULL) { + wrap=TRUE, maxcell=500000, stretch=NULL, legend="bottomright", shared=FALSE, panel=FALSE, collapse=TRUE, + # type=NULL, breaks=NULL, breakby="eqint", sort=TRUE, decreasing=FALSE, + map=NULL) { #checkLeafLetVersion() diff --git a/R/sample.R b/R/sample.R index 310caa70b..40aa4e9b4 100644 --- a/R/sample.R +++ b/R/sample.R @@ -405,7 +405,10 @@ sampleRaster <- function(x, size, method, replace, ext=NULL, warn) { # hasWin <- TRUE # hadWin <- window(x) # oldWin <- ext(x) - w <- intersect(ext(x), ext(ext)) + w <- intersect(ext(x), ext(ext)) + if (is.null(w)) { + error("sampleRaster", "x and ext do not intersect") + } x <- deepcopy(x) window(x) <- w } diff --git a/man/plot.Rd b/man/plot.Rd index c223a09fd..0e823531c 100644 --- a/man/plot.Rd +++ b/man/plot.Rd @@ -119,7 +119,7 @@ plot(r, type="interval") e <- c(6.37, 6.41, 49.9, 50.1) plot(r, plg=list(ext=e, title="Legend\nTitle", title.cex=0.9), - pax=list(side=1:4, retro=TRUE)) + pax=list(side=1:4, retro=FALSE)) north(cbind(5.8, 50.1)) d <- classify(r, c(100,200,300,400,500,600)) @@ -143,7 +143,7 @@ par(mfrow=c(1,2)) plot(r, range=c(50,600), mar=c(1,1,1,4)) plot(r/2, range=c(50,600), mar=c(1,1,1,4)) -# as we only need one legend: +# as we only need one legend: par(mfrow=c(1,2)) plot(r, range=c(50,600), mar=c(2, 2, 2, 2), plg=list(size=0.9, cex=.8), pax=list(side=1:2, cex.axis=.6), box=FALSE)