Skip to content

Instantly share code, notes, and snippets.

Avatar

Russell Dinnage rdinnager

View GitHub Profile
View ListToDf.md

Is there an easy way to convert a named list into a dataframe, preserving the elements of the list in a "list-column"?

library(dplyr)
library(magrittr)

## make a random matrix
rand_mat <- function() {
  Nrow <- sample(2:15,1)

Ncol <- sample(2:15,1)