data(vi_smol)
#creating fake geometry column without sf loaded
vi_smol$geometry <- NA
attr(
x = vi_smol,
which = "sf_column"
) <- "geometry"
#check new attribute
attributes(vi_smol)$sf_column
#drop geometry column
df <- drop_geometry_column(
df = vi_smol
)
#checking that the geometry was droppped
"geometry" %in% colnames(df)
attributes(df)$sf_column
Run the code above in your browser using DataLab