File: has_args.Rd

package info (click to toggle)
r-cran-assertthat 0.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 220 kB
  • sloc: sh: 9; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 693 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
30
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/assertions.r
\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")
}