% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dots.r
\name{suppr-dots}
\alias{suppr-dots}
\alias{dotsNames}
\alias{subDots}
\alias{dp1Dots}
\alias{checkDots}
\title{Process the \code{...} arguments of a function.}
\usage{
dotsNames(...)

subDots(...)

dp1Dots(..., collapse = " ", width.cutoff = 500L)

checkDots(..., error = TRUE, which.call = -1, allowed = character(0))
}
\arguments{
\item{...}{"the dots", as passed from the caller.}

\item{collapse}{a string, passed to \link{paste}.}

\item{width.cutoff}{integer in \verb{[20, 500]} determining the cutoff
(in bytes) at which line-breaking is tried.}

\item{error}{a logical value indicating whether to throw an error (\code{TRUE})
or a warning (\code{FALSE}) for extraneous arguments.}

\item{which.call}{passed to \link{sys.call}. A caller may use \code{-2} if the
message should mention its caller.}

\item{allowed}{character vector of named elements in \code{...} which are
"allowed" and hence do not cause an error or warning.}
}
\value{
For \code{dotsNames}, a character vector of the names of the \code{...} arguments.

For \code{subDots}, a list of expressions.

For \code{dp1Dots}, a character vector of deparsed expressions.

For \code{checkDots}, \code{NULL} (invisibly), called for its side effects.
}
\description{
\code{dotsNames} returns the names of the \code{...} arguments, or a character
vector of empty strings if they are unnamed (without evaluating
\code{...}).

\code{subDots} returns the \code{...} arguments as a list of expressions.

\code{dp1Dots} returns the \code{...} arguments as a character vector of deparsed
expressions.

\code{checkDots} errors or warns about extraneous arguments in the \code{...}
of its caller.
}
\details{
\code{dotsNames} is an implementation of \link{allNames} for \code{...} arguments.

\code{subDots} is a simple wrapper for \code{as.list(substitute(...()))}.

\code{dp1Dots} applies \link{deparse1} to each element of \code{subDots(...)}.

\code{checkDots} is a variation of \link{chkDots} for use in functions that want
to error in case of extraneous arguments, not just warn. \code{checkDots}
also shows whether extraneous arguments are named or unnamed, and if
unnamed, the message will show the deparsed expressions of the unnamed
arguments. See examples.
}
\examples{
f <- function(...) dotsNames(...)
f(1, 2, mean(1:10))
f(a = 1, b = 2, mean(1:10))

f <- function(...) subDots(...)
f(a = 1, b = 2, mean(1:10))

f <- function(...) dp1Dots(...)
f(a = 1, b = 2, mean(1:10))

f <- function(x, ...) checkDots(..., allowed = "b")
f(1, b = 1)
try(f(1, a = 1, b = 2, mean(1:10)))
}
\seealso{
\link{...}, \link{chkDots}, \link{stop}, \link{warning}, \link{substitute}, \link{deparse1}.
}
