R/binary.R

Defines functions binary

binary <- function(x, o, overwrite = FALSE){
  expr_calc <- paste0(o, " = if(isnull(", x,"), 0, 1)")
  flags <- "quiet"
  if(overwrite) flags <- c(flags, "overwrite")
  execGRASS(
    "r.mapcalc",
    flags = flags,
    parameters = list(expression = expr_calc)
  )
}

Try the rdwplus package in your browser

Any scripts or data that you put into this service are public.

rdwplus documentation built on April 4, 2025, 1:49 a.m.