% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/coercion.R
\name{coercion-factor}
\alias{coercion-factor}
\alias{as.factor}
\alias{as.ordered}
\title{Factor coercion}
\usage{
as.factor(x, ...)

as.ordered(x, ...)
}
\arguments{
\item{x}{A vector of data.}

\item{...}{Other arguments passed on to methods.}
}
\value{
For \code{as.factor()}, a factor. For \code{as.ordered()},
an ordered factor.
}
\description{
Coercion functions for creating factors from other existing objects.
}
\details{
These functions override non-generic factor coercion functions provided
in base so that packages can provide methods for different data types. The
default methods call the base versions.
}
\section{Methods}{


\subsection{\code{as.factor()}}{
\Sexpr[stage=render,results=rd]{generics:::methods_rd("as.factor")}
}

\subsection{\code{as.ordered()}}{
\Sexpr[stage=render,results=rd]{generics:::methods_rd("as.ordered")}
}
}

\examples{
as.factor(letters[1:5])
as.ordered(letters[1:5])

}
