MyNixOS website logo
Description

Recombinate Nested Lists to Dataframes.

Turns nested lists into data.frames in an orderly manner.

R recombinators Build Status Coverage Status

An R utility for turning nested lists into data.frames. This can be useful for turning JSON into R lists, and then into data.frames.

Installation

The latest stable build can be downloaded from CRAN:

install.packages("recombinator")

To install the latest development builds directly from GitHub, run this instead:

if (!require("devtools")) install.packages("devtools")
devtools::install_github("robertzk/recombinator")

Usage

There are two supported formats.

  • Homogeneous lists. A list where the first list element is a character vector giving the names of the data.frame, and the subsequent list elements themselves lists of values.
  • Heterogeneous lists. A list where each element is a named list of values. In this format, plyr::rbind will be used to take the union of all names and impute the ones missing with NA values.

Here are two examples of the respective format:

recombinator(list(c("a","b","c"), list(1, F, 2), list(2, T, 3)))
#   a     b c
# 1 1 FALSE 2
# 2 2  TRUE 3

recombinator(list(c("a","b","c"), list(1, F, 2), list(2, T, 3)))
# recombinator(list(list(a = 1, b = F, c = 2), list(a = 2, b = T, c = 3)))
#  a     b c
# 1 1 FALSE 2
# 2 2  TRUE 3

# The union of all observed keys is used for column names.
recombinator(list(list(a = 1, b = F, c = 2), list(a = 2, b = T, d = 4)))
#   a     b  c  d
# 1 1 FALSE  2 NA
# 2 2  TRUE NA  4
Metadata

Version

1.0.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows