strip_geometry | R Documentation |
Turns an sf
object into a tibble
and removes the geometry
column.
strip_geometry(.sf, .name_repair = "universal")
.sf |
an |
.name_repair |
Treatment of problematic column names:
This argument is passed on as |
This function improves on the sf_drop_geometry()
in sf
by
turning the object into a tibble
, rather than a data.frame
.
The original sf
as a tibble
and without the geometry
column.
## Not run:
sf <- tibble::tibble(
incident_type = c("fire", "flood", "cyclone"),
`Date start` = c("2020-08-13", "2020-09-17", "2020-10-24"),
`Responsible officials` = c("Tom", "Bob", "Jenny"),
lat = c(38.66, 18.3, 25.33),
lon = c(143.3, 132.7, 140.2)
) %>%
sf::st_as_sf(
coords = c("lon", "lat"),
crs = "+proj=longlat +datum=WGS84"
)
strip_geometry(.sf = sf, .name_repair = "universal")
strip_geometry(.sf = sf, .name_repair = "minimal")
strip_geometry(.sf = sf, .name_repair = "check_unique")
strip_geometry(.sf = sf, .name_repair = janitor::make_clean_names)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.