% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data_prepare.R
\name{standardize_binary_response}
\alias{standardize_binary_response}
\title{Standardise a binary response variable to 0/1 numeric}
\usage{
standardize_binary_response(y)
}
\arguments{
\item{y}{A vector that is 0/1 numeric, logical, or a two-level factor.}
}
\value{
A numeric vector of 0s and 1s.
}
\description{
Converts logical and two-level factor responses to 0/1 integer. Numeric
0/1 vectors are returned unchanged (as numeric). Other inputs raise an
error.
}
\details{
For factor inputs the first level is mapped to 0 and the second level is
mapped to 1.
}
\keyword{internal}
