drop_geometry_column: Removes 'geometry' Column From 'sf' Dataframes

View source: R/drop_geometry_column.R

drop_geometry_columnR Documentation

Removes geometry Column From sf Dataframes

Description

Remove geometry column from sf objects

Usage

drop_geometry_column(df = NULL, quiet = FALSE, ...)

Arguments

df

(required; dataframe, tibble, or sf) A dataframe with responses (optional) and predictors. Must have at least 10 rows for pairwise correlation analysis, and 10 * (length(predictors) - 1) for VIF. Default: NULL.

quiet

(optional; logical) If FALSE, messages are printed. Default: FALSE.

...

(optional) Internal args (e.g. function_name for validate_arg_function_name, a precomputed correlation matrix m, or cross-validation args for preference_order).

Value

dataframe

Author(s)

Blas M. Benito, PhD

See Also

Other argument_validation: validate_arg_df(), validate_arg_df_not_null(), validate_arg_encoding_method(), validate_arg_f(), validate_arg_function_name(), validate_arg_max_cor(), validate_arg_max_vif(), validate_arg_predictors(), validate_arg_preference_order(), validate_arg_quiet(), validate_arg_responses()

Examples

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


collinear documentation built on Dec. 8, 2025, 5:06 p.m.