as_lvec: Converts a primitive R-vector to lvec

View source: R/lvec.R

as_lvecR Documentation

Converts a primitive R-vector to lvec

Description

Converts a primitive R-vector to lvec

Usage

as_lvec(x)

Arguments

x

the object to convert. This can be a vector of type character, integer, numeric or logical.

Value

Returns an lvec of the same type as x. When x is already and lvec, x is returned. For character vectors the maximum length of the lvec is set to the maximum length found in x.

Examples

# convert a character vector to lvec
x <- as_lvec(letters)
lget(x, 1:26)


djvanderlaan/lvec documentation built on Oct. 26, 2022, 11:43 a.m.