container

Extends the functionality of base R list and provides specialized data structures deque, set, dict, and dict.table, the latter to extend the data.table package.

https://github.com/rpahl/container

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (19.7%) to scientific vocabulary

Keywords

container data-structures deque dict sets
Last synced: 6 months ago · JSON representation

Repository

Extends the functionality of base R list and provides specialized data structures deque, set, dict, and dict.table, the latter to extend the data.table package.

Basic Info
Statistics
  • Stars: 17
  • Watchers: 1
  • Forks: 2
  • Open Issues: 3
  • Releases: 2
Topics
container data-structures deque dict sets
Created almost 8 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
require(container)
require(badger)
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#",
  prompt = F,
  fig.path = "images/README-",
  tidy = FALSE,
  cache = FALSE,
  out.width = "100%"
)

old <- options(width = 100L)
```



[![CRAN release](https://www.r-pkg.org/badges/version/container)](https://cran.r-project.org/package=container)
[![Dependencies](https://tinyverse.netlify.app/badge/container)](https://CRAN.R-project.org/package=container)
[![Code coverage](https://codecov.io/gh/rpahl/container/branch/master/graph/badge.svg)](https://app.codecov.io/gh/rpahl/container)
[![R-CMD-check status](https://github.com/rpahl/container/workflows/R-CMD-check/badge.svg)](https://github.com/rpahl/container/actions)
[![Test coverage status](https://github.com/rpahl/container/workflows/test-coverage/badge.svg)](https://github.com/rpahl/container/actions)
[![CRAN checks](https://badges.cranchecks.info/summary/container.svg)](https://cran.r-project.org/web/checks/check_results_v01-interactive-usage.html)
[![Downloads per month](https://cranlogs.r-pkg.org/badges/last-month/container)](https://cran.r-project.org/package=container)
[![Downloads total](https://cranlogs.r-pkg.org/badges/grand-total/container)](https://cran.r-project.org/package=container)
[![Last commit](https://img.shields.io/github/last-commit/rpahl/container.svg)](https://github.com/rpahl/container/commits/master)
[![Lifecycle status](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)



# container logo

The {container} package offers 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 use {container}?

{container} objects work similar to base R lists and on top provide

* safe and flexible operations to
  * extract (custom default values, no unintended `NULL`)
  * add and replace (mixed indices, no unintended overrides)
  * remove (loose or strict deletion, remove by index or value)
* compact printing
* optional reference semantics

In addition, {container} provides specialized data structures
[Deque, Set, and Dict]( articles/v05-deque-set-dict.html)
and a *special* class `dict.table`, designed to extend
[data.table](https://CRAN.R-project.org/package=data.table) by
container operations to safely
[Manage data columns with dict.table](articles/v04-manage-data-columns.html).


### Installation

```{r, eval = FALSE}
# Install release version from CRAN
install.packages("container")

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


### Usage

```{r}
library(container)
co <- container(colors = c("Red", "Green"), numbers = c(1, 2, 3), data = cars)

co
```

Use like a base R list

```{r}
co[["colors"]] <- c("Blue", "Yellow")

co[["colors"]]

co[2:1]
```

Safe extract

```{r, error = TRUE}
at(co, "colours")   # oops

at(co, "colors")
```

Safe remove

```{r, error = TRUE}
co <- delete_at(co, "colours")   # oops

co <- delete_at(co, "colors")
co
```

Flexible peek

```{r, error = TRUE}
at(co, "colors")   # oops

peek_at(co, "colors")

peek_at(co, "colors", .default = c("black", "white"))
```

Safe replace

```{r, error = TRUE}
co <- replace_at(co, num = 1:10)   # oops

co <- replace_at(co, numbers = 1:10)
co
```

### Get started

* [Use container in interactive session](articles/v01-interactive-usage.html)
* [Use container for code development](articles/v02-code-development.html)
* [Manage parameter lists with dict](articles/v03-parameter-list.html)
* [Manage data columns with dict.table](articles/v04-manage-data-columns.html)


### When *not* to use {container}

Don't bother using the {container} framework when *speed* is of high importance.
An exception is the `dict.table` class, which is very fast as it is based on
[data.table](https://CRAN.R-project.org/package=data.table).
Other than that, if computation speed is critical for your application,
we refer you to using base R lists or packages that were optimized for
performance, such as the
[collections](https://CRAN.R-project.org/package=collections) or
[cppcontainers](https://cran.r-project.org/package=cppcontainers) package.


```{r, include = FALSE}
options(old)
```

Owner

  • Name: Roman Pahl
  • Login: rpahl
  • Kind: user
  • Location: Germany

GitHub Events

Total
  • Create event: 8
  • Issues event: 8
  • Release event: 1
  • Watch event: 2
  • Delete event: 7
  • Push event: 11
  • Pull request event: 12
Last Year
  • Create event: 8
  • Issues event: 8
  • Release event: 1
  • Watch event: 2
  • Delete event: 7
  • Push event: 11
  • Pull request event: 12

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 461
  • Total Committers: 3
  • Avg Commits per committer: 153.667
  • Development Distribution Score (DDS): 0.069
Past Year
  • Commits: 2
  • Committers: 2
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.5
Top Committers
Name Email Commits
Roman Pahl r****l@g****m 429
Roman Pahl r****l@g****m 31
Toby Dylan Hocking t****g@r****g 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 5
  • Total pull requests: 31
  • Average time to close issues: about 13 hours
  • Average time to close pull requests: 12 days
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.45
  • Merged pull requests: 28
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 5
  • Pull requests: 6
  • Average time to close issues: about 13 hours
  • Average time to close pull requests: 4 minutes
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • rpahl (5)
Pull Request Authors
  • rpahl (34)
  • tdhock (1)
Top Labels
Issue Labels
enhancement (1) documentation (1)
Pull Request Labels
documentation (5)

Packages

  • Total packages: 1
  • Total downloads:
    • cran 404 last-month
  • Total docker downloads: 41,971
  • Total dependent packages: 1
  • Total dependent repositories: 2
  • Total versions: 8
  • Total maintainers: 1
cran.r-project.org: container

Extending Base 'R' Lists

  • Versions: 8
  • Dependent Packages: 1
  • Dependent Repositories: 2
  • Downloads: 404 Last month
  • Docker Downloads: 41,971
Rankings
Docker downloads count: 0.6%
Stargazers count: 14.2%
Average: 16.7%
Forks count: 17.1%
Dependent packages count: 18.2%
Dependent repos count: 19.4%
Downloads: 30.7%
Maintainers (1)
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.5.0 depends
  • R6 * imports
  • data.table * imports
  • methods * imports
  • dplyr * suggests
  • ggplot2 * suggests
  • knitr * suggests
  • microbenchmark * suggests
  • rmarkdown * suggests
  • tibble * suggests
  • tinytest * suggests
.github/workflows/test-coverage.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-r v1 composite
  • r-lib/actions/setup-r-dependencies v1 composite
.github/workflows/check-standard.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite