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
rvec
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() to construct an rvec.
rvec()
expand_from_rvec() to convert a data frame from using rvecs to using draw and value columns.
expand_from_rvec()
draw
value
as_rvar???
converting rvecs to
Functions for summarising and plotting distributions in package ggdist understand list columns.
l <- list(1:3, 4:6) r <- rvec(l) as_list_col(r)
Run the code above in your browser using DataLab