File: has_args.Rd

package info (click to toggle)
r-cran-assertthat 0.1-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 188 kB
  • sloc: sh: 9; makefile: 1
file content (29 lines) | stat: -rw-r--r-- 613 bytes parent folder | download | duplicates (2)
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
\name{has_args}
\alias{\%has_args\%}
\alias{has_args}
\title{Check a function has specified arguments}
\usage{
has_args(f, args, exact = FALSE)

f \%has_args\% args
}
\arguments{
  \item{f}{a function}

  \item{args}{a character vector of argument names}

  \item{exact}{if \code{TRUE}, argument names must match
  \code{args} exactly (order and value); otherwise \code{f}
  just must have at least \code{args} in any order}
}
\description{
Check a function has specified arguments
}
\examples{
has_args(mean, "x")
has_args(mean, "x", exact = TRUE)

see_if(mean \%has_args\% "x")
see_if(mean \%has_args\% "y")
}