The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

CRAN_Status_Badge dependencies codecov.io R-CMD-check downloads total-downloads last-commit Lifecycle_Badge

container

container provides an enhanced version of base R’s list with a carefully designed set of extract, replace, and remove operations that make it easier and safer to work with list-like data structures.

Why container?

In addition, this package provides specialized data structures Deque, Set and Dict and a special class dict.table, designed to extend data.table by container operations to safely Manage data columns with dict.table.

Installation

# Install release version from CRAN
install.packages("container")

# Install development version from GitHub
devtools::install_github("rpahl/container")

Usage

library(container)
co <- container(colors = c("Red", "Green"), numbers = c(1, 2, 3), data = cars)
co
# [colors = ("Red" "Green"), numbers = (1 2 3), data = <<data.frame(50x2)>>]

Safe extract

at(co, "colours")   # oops
# Error: index 'colours' not found

at(co, "colors")
# [colors = ("Red" "Green")]

Safe remove

co <- delete_at(co, "colours")   # oops
# Error: names(s) not found: 'colours'

co <- delete_at(co, "colors")
co
# [numbers = (1 2 3), data = <<data.frame(50x2)>>]

Flexible peek

at(co, "colors")   # oops
# Error: index 'colors' not found

peek_at(co, "colors")
# []

peek_at(co, "colors", .default = c("black", "white"))
# [colors = ("black" "white")]

Safe replace

co <- replace_at(co, num = 1:10)   # oops
# Error: names(s) not found: 'num'

co <- replace_at(co, numbers = 1:10)
co
# [numbers = (1L 2L 3L 4L ...), data = <<data.frame(50x2)>>]

Getting Started

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.