View source: R/fun-drop_geometry.R
st_drop_geometry_if | R Documentation |
the function can remove geometry from a data set with class 'sf' i.e removes the crs and geometry information. 'SC_boundary' is a shape file with class 'sf' and 'data.frame'. When the shape file is viewed it has two polygons, each with attributes (columns of) for 'State', 'Area', 'Name', 'Shape_Area', 'Shape_Len', 'XCoord', 'YCoord', 'geometry', and CRS information. After using this function, the attribute columns are preserved, except geometry column. Thereby converting the shape file into a regular data frame.
st_drop_geometry_if(x)
x |
a shape file with class 'sf' and 'data.frame' |
a data.frame
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.