We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
terra
dismo
mess
Those using raster inputs so don't have to go through the endless drudgery of conversion to raster and back again. The horror. The horror.
raster
library(dismo) #> Loading required package: raster #> Loading required package: sp
mess #> function (x, v, full = FALSE, filename = "", ...) #> { #> stopifnot(NCOL(v) == nlayers(x)) #> out <- raster(x) #> nl <- nlayers(x) #> filename <- trim(filename) #> nms <- paste(names(x), "_mess", sep = "") #> if (canProcessInMemory(x)) { #> x <- getValues(x) #> if (nl == 1) { #> rmess <- .messi3(x, v) #> names(out) <- "mess" #> out <- setValues(out, rmess) #> } #> else { #> x <- sapply(1:ncol(x), function(i) .messi3(x[, i], #> v[, i])) #> rmess <- apply(x, 1, min, na.rm = TRUE) #> if (full) { #> out <- brick(out, nl = nl + 1) #> names(out) <- c(nms, "mess") #> out <- setValues(out, cbind(x, rmess)) #> } #> else { #> names(out) <- "mess" #> out <- setValues(out, rmess) #> } #> } #> if (filename != "") { #> out <- writeRaster(out, filename, ...) #> } #> return(out) #> } #> else { #> if (nl == 1) { #> names(out) <- "mess" #> tr <- blockSize(out) #> pb <- pbCreate(tr$n, ...) #> out <- writeStart(out, filename, ...) #> for (i in 1:tr$n) { #> vv <- getValues(x, row = tr$row[i], nrows = tr$nrows[i]) #> vv <- .messi3(vv, v) #> out <- writeValues(out, vv, tr$row[i]) #> pbStep(pb) #> } #> } #> else { #> if (full) { #> out <- brick(out, nl = nl + 1) #> names(out) <- c(nms, "mess") #> tr <- blockSize(out) #> pb <- pbCreate(tr$n, ...) #> out <- writeStart(out, filename, ...) #> for (i in 1:tr$n) { #> vv <- getValues(x, row = tr$row[i], nrows = tr$nrows[i]) #> vv <- sapply(1:ncol(v), function(i) .messi3(vv[, #> i], v[, i])) #> m <- apply(vv, 1, min, na.rm = TRUE) #> out <- writeValues(out, cbind(vv, m), tr$row[i]) #> pbStep(pb) #> } #> } #> else { #> names(out) <- "mess" #> tr <- blockSize(out) #> pb <- pbCreate(tr$n, ...) #> out <- writeStart(out, filename, ...) #> for (i in 1:tr$n) { #> vv <- getValues(x, row = tr$row[i], nrows = tr$nrows[i]) #> vv <- sapply(1:ncol(v), function(i) .messi3(vv[, #> i], v[, i])) #> m <- apply(vv, 1, min, na.rm = TRUE) #> out <- writeValues(out, m, tr$row[i]) #> pbStep(pb) #> } #> } #> } #> out <- writeStop(out) #> pbClose(pb) #> } #> out #> } #> <bytecode: 0x14bb10c20> #> <environment: namespace:dismo>
Created on 2024-08-16 with reprex v2.1.0
The text was updated successfully, but these errors were encountered:
geryan
No branches or pull requests
Those using
raster
inputs so don't have to go through the endless drudgery of conversion to raster and back again. The horror. The horror.Created on 2024-08-16 with reprex v2.1.0
The text was updated successfully, but these errors were encountered: