% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data_utils.R
\name{to_long}
\alias{to_long}
\title{Convert Wide Data to Long Format}
\usage{
to_long(data, within = NULL, label = NULL, value = "Value", id = NULL)
}
\arguments{
\item{data}{A data frame in wide format.}

\item{within}{The columns to gather into long format. Can be:
\itemize{
  \item A character vector of column names.
  \item A range string like \code{"time1:time4"}.
  \item A prefix string like \code{"time"} (matches all columns starting with "time").
}}

\item{label}{The name for the new column that will contain the level names (e.g., "Time"). 
If NULL, it defaults to the prefix used in \code{within} or "Condition".}

\item{value}{The name for the new column that will contain the measurement values. 
Default is "Value".}

\item{id}{The identifier columns that should be repeated for each row. 
If NULL (default), all columns NOT specified in \code{within} are treated as IDs.}
}
\value{
A data frame in long format.
}
\description{
A highly intuitive wrapper around \code{stats::reshape} designed for 
psychological research. It converts data from wide format to long format
by identifying within-subjects factors.
}
