% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data_conversion.R
\name{action_to_onehot}
\alias{action_to_onehot}
\title{Convert Action Column to One-Hot Encoding}
\usage{
action_to_onehot(
  data,
  action_col = "Action",
  states = NULL,
  drop_action = TRUE,
  sort_states = FALSE,
  prefix = ""
)
}
\arguments{
\item{data}{Data frame containing an action column.}

\item{action_col}{Character. Name of the action column. Default: "Action".}

\item{states}{Character vector or NULL. States to include as columns.
If NULL, uses all unique values. Default: NULL.}

\item{drop_action}{Logical. Remove the original action column. Default: TRUE.}

\item{sort_states}{Logical. Sort state columns alphabetically. Default: FALSE.}

\item{prefix}{Character. Prefix for state column names. Default: "".}
}
\value{
Data frame with one-hot encoded columns (0/1 integers).
}
\description{
Convert a categorical Action column to one-hot (binary indicator) columns.
}
\examples{
long_data <- data.frame(
  Actor = rep(1:3, each = 4),
  Time = rep(1:4, 3),
  Action = sample(c("A", "B", "C"), 12, replace = TRUE)
)
onehot_data <- action_to_onehot(long_data)
head(onehot_data)

}
