IsVector: Test for a Vector

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/IsVector.R

Description

IsVector() returns TRUE if v is a vector, and FALSE otherwise.

Usage

1
2
3
4
5
6
7
IsVector(v)

## Default S3 method:
IsVector(v)

## S3 method for class 'yac_symbol'
IsVector(v)

Arguments

v

Input.

Details

A vector is an array of numbers, symbols, or expressions, typically denoted by lowercase roman letters such as \mathbf{v} and \mathbf{u}.

v is considered to be a vector if is.vector(v) returns TRUE or v is a matrix and dim(v)[1] == 1 | dim(v)[2] == 1 returns TRUE.

Value

Logical.

Author(s)

Ivan Jacob Agaloos Pesigan

References

Wikipedia: Row and column vectors

See Also

Other predicate functions: IsDiagonal(), IsIdempotent(), IsInvertible(), IsMatrix(), IsNilpotent(), IsOrthogonal(), IsPositiveDefinite(), IsScalar(), IsSingular(), IsSquareMatrix(), IsSymmetric(), MatrixCheck()

Examples

1
2
3
4
5
6
7
# TRUE
IsVector(1:5)
IsVector(matrix(1:5, ncol = 1))
IsVector(matrix(1:5, nrow = 1))

# FALSE
IsVector(matrix(1:10, ncol = 2))

jeksterslab/matrixR documentation built on Feb. 22, 2021, 8:10 a.m.