Learn R Programming

str2str (version 0.2.1)

is.avector: Test for an Atomic Vector

Description

is.avector returns whether an object is an atomic vector with typeof character, logical, integer, or double.

Usage

is.avector(x)

Value

logical vector with length 1 specifying whether `x` is an atomic vector.

Arguments

x

= object whose structure is desired to be tested.

Details

is.avector is simply a logical "and" of is.atomic and is.vector.

Examples

Run this code
is.avector(x = c(1,2,3))
is.avector(x = array(c(1,2,3))) # returns false for arrays
is.avector(x = list(1,2,3)) # returns false for lists

Run the code above in your browser using DataLab