powered by
Convert an rvec or matrix to a list that can be used as a list column in a data frame.
as_list_col(x)# S3 method for rvec as_list_col(x)# S3 method for matrix as_list_col(x)
# S3 method for rvec as_list_col(x)
# S3 method for matrix as_list_col(x)
A list:
If x is an rvec, then the list contains length(x) vectors, each of which has n_draw(x) elements.
x
length(x)
n_draw(x)
If x is a matrix, then the list contains nrow(x) vectors, each of which has ncol(x) elements.
nrow(x)
ncol(x)
An rvecs or matrix.
rvec() Construct an rvec.
rvec()
expand_from_rvec() Convert a data frame from 'rvec' format to 'draw-and-value' format
expand_from_rvec()
Functions for summarising and plotting distributions in package ggdist use list columns (among other formats).
l <- list(1:3, 4:6) r <- rvec(l) as_list_col(r)
Run the code above in your browser using DataLab