list-lsd {debkeepr}R Documentation

Cast deb_lsd or deb_tetra to a list of values

Description

Cast a deb_lsd or deb_tetra vector to a list of numeric vectors either three or four values per list item corresponding to lsd or tetra values.

Usage

deb_as_list(x, ...)

## Default S3 method:
deb_as_list(x, ...)

## S3 method for class 'deb_lsd'
deb_as_list(x, ...)

## S3 method for class 'deb_tetra'
deb_as_list(x, ...)

Arguments

x

A deb_lsd or deb_tetra vector to cast to a list of values.

...

Arguments passed on to further methods.

Details

deb_as_list() turns a deb_lsd or deb_tetra vector into a list of numeric vectors of length 3 or 4. It is the inverse of deb_as_lsd() and deb_as_tetra(). Compare to as.list(), which creates a list of deb_lsd or deb_tetra vectors or unclass(), which creates a list of length 3 or 4 with numeric vectors corresponding to the units.

Value

A list of numeric vectors of length 3 or 4, corresponding to lsd or tetra values.

See Also

deb_as_lsd() and deb_as_tetra() for the inverse of deb_as_list().

Examples


# deb_lsd vector
x <- deb_lsd(l = 0:3, s = 4:7, d = 8:11)

deb_as_list(x)

# deb_tetra vector

y <- deb_tetra(l = 0:3, s = 4:7, d = 8:11, f = 1:4)

deb_as_list(y)

# This is the inverse of `deb_as_lsd()` of a list of lsd values
z <- deb_as_list(x)

identical(x, deb_as_lsd(z))


[Package debkeepr version 0.1.1 Index]