namedvector function

Named vectors and the frab package

Named vectors and the frab package

Named vectors are closely related to frab objects, but are not the same. However, there is a natural coercion from one to the other.

as.namedvector(v) is.namedvector(v) is.namedlogical(v) is.unnamedlogical(v) is.unnamedvector(v)

Arguments

  • v: Argument to be tested or coerced

Details

Coercion and testing for named vectors. Function nv_to_frab(), documented at frab.Rd, coerces a named vector to a frab.

Returns

Function is.namedvector() returns a boolean, function as.namedvector() returns a named vector.

Author(s)

Robin K. S. Hankin

Note

The issue of named logical vectors in the frab package is discussed briefly at inst/wittgenstein.Rmd.

Examples

x <- c(a=5, b=3, c=-2,b=-3, x=33) is.namedvector(x) as.namedvector(frab(x)) x <- c(a=5, b=3, c=-2) y <- c(p=1, c=2, d= 6) x y x+y frab(x) + frab(y)
  • Maintainer: Robin K. S. Hankin
  • License: GPL (>= 2)
  • Last published: 2024-07-24