R/df_to_list.R

Defines functions df_to_list

Documented in df_to_list

df_to_list <- function(df) {
  if(!(is.data.frame(df)))
    stop("df_to_list requires a data.frame object; please verify that df is of the correct type.")
  stats::setNames(lapply(split(df, seq(nrow(df))),
                  FUN = function (x) {
                    as.list(x)
                  }), NULL)
}

Try the dashTable package in your browser

Any scripts or data that you put into this service are public.

dashTable documentation built on July 2, 2020, 2:35 a.m.