% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/default.r
\name{default}
\alias{default}
\alias{\%||\%}
\alias{\%|\%}
\title{Retrieve a value or a default}
\usage{
a \%||\% b

lhs \%|\% rhs
}
\arguments{
\item{a}{the value to return if non-empty}

\item{b}{default value}

\item{lhs}{vector with potentially missing values, or \code{NULL}}

\item{rhs}{vector with default values, same length as \code{lhs} unless that
is \code{NULL}}
}
\value{
\code{a \%||\% b} returns \code{a}, unless it is \code{NULL}, empty,
\code{FALSE} or \code{""}; in which case \code{b} is returned.

\code{lhs \%|\% rhs} returns a vector of the same length as
\code{rhs} with all missing values in \code{lhs} replaced by the
corresponding values in \code{rhs}.
}
\description{
\code{a \%||\% b} returns \code{a} unless it is empty, in which case
\code{b} is returned.
}
\keyword{internal}
