% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/validate_arg_df.R
\name{validate_arg_df}
\alias{validate_arg_df}
\title{Check and prepare argument \code{df}}
\usage{
validate_arg_df(
  df = NULL,
  responses = NULL,
  predictors = NULL,
  quiet = FALSE,
  function_name = NULL
)
}
\arguments{
\item{df}{(required; dataframe, tibble, or sf) A dataframe with responses
(optional) and predictors. Must have at least 10 rows for pairwise
correlation analysis, and \code{10 * (length(predictors) - 1)} for VIF.
Default: NULL.}

\item{responses}{(optional; character, character vector, or NULL) Name of
one or several response variables in \code{df}. Default: NULL.}

\item{predictors}{(optional; character vector or NULL) Names of the
predictors in \code{df}. If NULL, all columns except \code{responses} and
constant/near-zero-variance columns are used. Default: NULL.}

\item{quiet}{(optional; logical) If FALSE, messages are printed. Default: FALSE.}

\item{function_name}{(optional, character string) Name of the function performing the argument check. Default: NULL}
}
\value{
dataframe
}
\description{
Internal function to validate the integrity of the argument \code{df}. It ensures that the dataframe has suitable dimensions for a multicollinearity analysis, transforms logical columns to numeric, character columns to factors, and converts \code{NaN}, \code{Inf} and \code{-Inf} to NA. Additionally, it checks the values of \code{responses} and \code{predictors} if these arguments are provided.
}
\examples{

data(vi_smol, vi_predictors, package = "spatialData")
vi_predictors_numeric <- identify_numeric_variables(
  df = vi_smol,
  predictors = vi_predictors
)$valid

df <- validate_arg_df(
  df = vi_smol,
  responses = "vi_numeric",
  predictors = vi_predictors_numeric,
  quiet = FALSE
)

attributes(vi)$validated
}
\seealso{
Other argument_validation:
\code{\link[=drop_geometry_column]{drop_geometry_column()}},
\code{\link[=validate_arg_df_not_null]{validate_arg_df_not_null()}},
\code{\link[=validate_arg_encoding_method]{validate_arg_encoding_method()}},
\code{\link[=validate_arg_f]{validate_arg_f()}},
\code{\link[=validate_arg_function_name]{validate_arg_function_name()}},
\code{\link[=validate_arg_max_cor]{validate_arg_max_cor()}},
\code{\link[=validate_arg_max_vif]{validate_arg_max_vif()}},
\code{\link[=validate_arg_predictors]{validate_arg_predictors()}},
\code{\link[=validate_arg_preference_order]{validate_arg_preference_order()}},
\code{\link[=validate_arg_quiet]{validate_arg_quiet()}},
\code{\link[=validate_arg_responses]{validate_arg_responses()}}
}
\concept{argument_validation}
