/
check_vector.Rd
62 lines (51 loc) · 1.81 KB
/
check_vector.Rd
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vector.R
\name{check_vector}
\alias{check_vector}
\title{Check Atomic Vector}
\usage{
check_vector(
x,
values = NULL,
length = NA,
unique = FALSE,
sorted = FALSE,
named = NA,
attributes = named,
names = TRUE,
class = TRUE,
only = FALSE,
x_name = substitute(x),
error = TRUE
)
}
\arguments{
\item{x}{The object to check.}
\item{values}{NULL or a vector specifying the values.}
\item{length}{A flag indicating whether x should have elements (versus no elements)
or a missing value indicating no requirements or a count or count range of the
number of elements or a count vector of the permitted number of elements.}
\item{unique}{A flag indicating whether the values must be unique.}
\item{sorted}{A flag indicating whether the vector must be sorted.}
\item{named}{A flag indicating whether the vector must be named or unnamed or NA if it doesn't matter.}
\item{attributes}{A flag indicating whether the vector must or must not have attributes or NA if it doesn't matter.}
\item{names}{A flag specifying whether names should be considered an
attribute.}
\item{class}{A flag specifying whether class should be considered an
attribute.}
\item{only}{A flag indicating whether only the actual values are permitted.
It only affects values with two or less non-missing elements.}
\item{x_name}{A string of the name of the object x.}
\item{error}{A flag indicating whether to throw an informative error or
immediately generate an informative message if the check fails.}
}
\value{
An invisible copy of x (if it doesn't throw an error).
}
\description{
Check Atomic Vector
}
\examples{
check_vector(2:1, length = 3, sorted = TRUE, named = TRUE, error = FALSE)
check_vector(c("one", "two", "four"), values = c("one", "two", "two"), error = FALSE)
}