R/sf_area.R

Defines functions sf_area

Documented in sf_area

#' sf_area
#'
#' Extract area values from sf features.
#'
#' @param x sf feature type.
#'
#' @return Dataframe with added column representing area
#' @export
#'
#' @examples
#' \dontrun{
#' }
#'

sf_area <- function(x) {
  suppressWarnings(
    x |>
      dplyr::bind_cols(x |>
                         sf::st_area() |>
                         tibble::as_tibble() |>
                         dplyr::rename(area = value) |>
                         dplyr::mutate(area = as.numeric(area)))
  )

}
toddellis/miao documentation built on June 1, 2025, 10:11 p.m.