% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/paintr-data.R
\name{ptr_normalize_column_names}
\alias{ptr_normalize_column_names}
\title{Normalize Dataset Column Names for \code{ggpaintr}}
\usage{
ptr_normalize_column_names(data)
}
\arguments{
\item{data}{A data frame or an object coercible with \code{as.data.frame()}.}
}
\value{
A tabular object with \code{ggpaintr}-safe column names. Existing
\code{data.frame} subclasses keep their class. Names are made syntactic, unique,
and safe against reserved-word collisions. Non-\code{data.frame} inputs return
the \code{data.frame} created by \code{as.data.frame()}.
}
\description{
Normalize incoming column names so \code{ppVar} placeholders can require exact,
syntactic, unique column-name matches at runtime.
}
\details{
Uploaded data is normalized automatically by the runtime — every
successful \code{ppUpload} placeholder passes through this function (or its
\code{data.frame}-coercing sibling for non-\code{data.frame} returns from
\code{readRDS} / \code{readxl} / \code{jsonlite}). Call \code{ptr_normalize_column_names()}
yourself only for \strong{in-session} data frames you reference by name from
a formula. If a local data frame has spaces, reserved words, or
duplicates in its column names, pipe it through this function before
passing it to \code{ptr_app()}.
}
\examples{
messy <- data.frame(
  check.names = FALSE,
  "first column" = 1:3,
  "if" = 4:6
)

clean <- ptr_normalize_column_names(messy)
names(clean)
}
