R/deprecated.R

Defines functions grid_neighbor

Documented in grid_neighbor

#' Neighborhood grid square codes (Deprecated)
#'
#' `r lifecycle::badge("deprecated")`
#'
#' @param grid A `grid` vector.
#' @param n A numeric vector of degrees. By default, `1L`.
#' @param moore Moore neighborhood (`TRUE`, default) or Von Neumann neighborhood
#' (`FALSE`).
#' @param simplify Should simplify the format of the return?
#'
#' @return A list of `grid` vectors.
#'
#' @export
grid_neighbor <- function(grid,
                          n = 1L,
                          moore = TRUE,
                          simplify = TRUE) {
  lifecycle::deprecate_warn("0.5.0",
                            what = "grid_neighbor()",
                            details = 'Please use `grid_neighborhood(type = "moore")`')

  grid_neighborhood(grid,
                    n = n,
                    type = if (moore) "moore" else "von_neumann",
                    simplify = simplify)
}

Try the jpgrid package in your browser

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

jpgrid documentation built on May 29, 2024, 4:53 a.m.