is_vector: Check if argument is vector with given properties

Description Usage Arguments Examples

Description

Checks if argument is vector with given length and mode. Used to control arguments. Returns error when object does not match given properties.

Usage

1
is_vector(vector, length = 1, mode = "character")

Arguments

vector

Input object.

length

Required length of vector.

mode

Required mode of vector

Examples

1
2
3
4
5
6
7
8
9
is_vector(c(1:9),9,'numeric')
is_vector('a')
is_vector(TRUE,mode='logical')

## Not run: 
is_vector(TRUE,mode='character')
is_vector(c('a','b'),length=3)
is_vector(iris)
## End(Not run)

tomasgreif/mondrianr documentation built on May 31, 2019, 5:15 p.m.