Convert an rvec or matrix to a list that can be used as a list column in a data frame.
Usage
as_list_col(x)
# S3 method for class 'rvec'
as_list_col(x)
# S3 method for class 'matrix'
as_list_col(x)Arguments
- x
An rvecs or matrix.
Value
A list:
If
xis an rvec, then the list containslength(x)vectors, each of which hasn_draw(x)elements.If
xis a matrix, then the list containsnrow(x)vectors, each of which hasncol(x)elements.
See also
rvec()Construct an rvec.expand_from_rvec()Convert a data frame from 'rvec' format to 'draw-and-value' formatFunctions for summarising and plotting distributions in package ggdist use list columns (among other formats).