is.vector {base} R Documentation

‘is.vector’ returns ‘TRUE’ if ‘x’ is a vector of the specified

Description

mode having no attributes other than names. It returns 'FALSE’
otherwise.

Usage

is.vector(x,
    mode = "any");

Arguments

x

an R object.

mode

character string naming an atomic mode or ‘"list"’ or '"expression"’ or (except for ‘vector’) ‘"any"’. Currently, 'is.vector()’ allows any type (see ‘typeof’) for ‘mode’, and when mode Is Not '"any"’, ‘is.vector(x, mode)’ is almost the same as 'typeof(x) == mode’.

Details

The atomic modes are ‘"logical"’, ‘"integer"’, ‘"numeric"’ (synonym '"double"’), ‘"complex"’, ‘"character"’ and ‘"raw"’.

If 'mode = "any"’, ‘is.vector’ may return ‘TRUE’ for the atomic modes, 'list’ and ‘expression’. For any ‘mode’, it will return 'FALSE’ if ‘x’ has any attributes except names. (This is incompatible with S.) On the other hand, 'as.vector’ removes all attributes including names For results Of atomic mode (but Not those of mode '"list"’ nor ‘"expression"’).

Note that factors are not vectors; 'is.vector’ returns ‘FALSE’ And 'as.vector’ converts a factor to a character vector for ‘mode = "any"'.

Authors

SMRUCC genomics Institute

Value

this function returns data object of type boolean.

clr value class

Examples


[Package base version 2.33.856.6961 Index]