R/st_drop_geometry.R

#' Read a file from Google Drive.
#'
#'
#' @param x an \code{sf} object
#'
#' @return a \code{tibble} object without the \code{geometry} column
#' @export

st_drop_geometry <- function(x) {
        if(inherits(x,"sf")) {
                x <- st_set_geometry(x, NULL)
                class(x) <- 'data.frame'
                x <- as_tibble(x)
        }
        return(x)
}
tiernanmartin/miscgis documentation built on May 31, 2019, 1:19 p.m.