is.vector {base} | R Documentation |
mode having no attributes other than names. It returns 'FALSE’
otherwise.
is.vector(x,
mode = "any");
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"'.