1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cause.R
\name{set_cause}
\alias{set_cause}
\title{Set a cause and return the input}
\usage{
set_cause(x, false_value, missing_value = "missing")
}
\arguments{
\item{x}{A variable.}
\item{false_value}{A character vector to set the cause to, where \code{x} is
\code{FALSE}.}
\item{missing_value}{A character vector to set the cause to, where \code{x} is
\code{NA}.}
}
\value{
\code{x}, with a new cause attribute.
}
\description{
Sets the cause attribute of an object and returns that object.
}
\details{
If \code{x} is \code{TRUE} everywhere, this returns the input
without setting a cause. Otherwise, the cause is an empty string where
\code{x} is \code{TRUE}, \code{false_value} where it is \code{FALSE}, and
\code{missing_value} where it is \code{NA}.
}
\seealso{
\code{\link{cause}}, \code{\link[stats]{setNames}}
}
|