% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/infer_data_types.R
\name{infer_data_types}
\alias{infer_data_types}
\title{Smart Type Coercion & NA Recognition}
\usage{
infer_data_types(
  data,
  na_strings = c("-", "N/A", "n/a", "n.m.", "n.m", "NA", "null", "NULL", "."),
  num_threshold = 0.95
)
}
\arguments{
\item{data}{A \code{data.frame}.}

\item{na_strings}{A character vector of strings to be interpreted as \code{NA}.}

\item{num_threshold}{Numeric between 0 and 1. The proportion of valid numbers required to convert a column to numeric. Default is \code{0.95}.}
}
\value{
A \code{data.frame} with inferred data types.
}
\description{
\code{infer_data_types()} scans character columns in a data frame, identifies common
financial placeholders for missing data (e.g., "-", "N/A", "n.m."), safely replaces
them with \code{NA}, and then coerces the column to \code{numeric} or \code{Date} if a high
percentage of the remaining values match those types.
}
\examples{
# Clean financial placeholders and coerce to numeric
df <- data.frame(val = c("1.5", "-", "2.0", "N/A"), stringsAsFactors = FALSE)
df_clean <- infer_data_types(df)
df_clean$val  # numeric: c(1.5, NA, 2.0, NA)
is.numeric(df_clean$val)  # TRUE

}
