R/as.sfc.cartogramR.R

Defines functions as.sfc.cartogramR

Documented in as.sfc.cartogramR

#' Coerce a cartogramR to a sfc object
#'
#' Coerce a cartogramR to a  sfc object extracting the component cartogram of
#'  the cartogramR object
#'
#' @param x a cartogramR object
#' @param   \\dots arguments passed to or from other methods.
#'
#' @return a sfc object
#'
#' @rdname as.sfc.cartogramR
#' @export
#'
#' @md
as.sfc.cartogramR <- function(x, ...) {
    if  (!inherits(x, "cartogramR")) stop(paste(deparse(substitute(x)), "must be a cartogramR object"))
    return(x$cartogram)
}

Try the cartogramR package in your browser

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

cartogramR documentation built on Oct. 18, 2022, 5:08 p.m.