Learn R Programming

lvec (version 0.2.5)

as_lvec: Converts a primitive R-vector to lvec

Description

Converts a primitive R-vector to lvec

Usage

as_lvec(x)

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.

Arguments

x

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

Examples

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

Run the code above in your browser using DataLab