rvec {rvec}R Documentation

Create an Rvec

Description

Create an Object of Class "rvec".

Usage

rvec(x)

rvec_chr(x = NULL)

rvec_dbl(x = NULL)

rvec_int(x = NULL)

rvec_lgl(x = NULL)

Arguments

x

A matrix, a list of vectors, or an atomic vector.

Details

Class "rvec" has four subclasses, each dealing with a diffent type:

These subclasses are analogous to double(), integer(), logical(), and character() vectors.

Function rvec() chooses the subclass, based on x. Functions rvec_dbl(), rvec_int(), rvec_lgl(), and rvec_chr() each create objects of a particular subclass.

x can be

Value

An rvec with the following class:

See Also

Examples

m <- rbind(c(-1.5, 2, 0.2),
           c(-2.3, 3, 1.2))
rvec_dbl(m)

l <- list(rpois(100, lambda = 10.2),
          rpois(100, lambda = 5.5))
rvec(l)

rvec(letters[1:5])

l <- list(a = c(TRUE, FALSE),
          b = c(FALSE, TRUE))
rvec(l)

[Package rvec version 0.0.6 Index]