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.
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
- Host: GitHub
- Owner: rpahl
- Language: R
- Default Branch: master
- Homepage: https://rpahl.github.io/container/
- Size: 4.69 MB
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)
```
[](https://cran.r-project.org/package=container)
[](https://CRAN.R-project.org/package=container)
[](https://app.codecov.io/gh/rpahl/container)
[](https://github.com/rpahl/container/actions)
[](https://github.com/rpahl/container/actions)
[](https://cran.r-project.org/web/checks/check_results_v01-interactive-usage.html)
[](https://cran.r-project.org/package=container)
[](https://cran.r-project.org/package=container)
[](https://github.com/rpahl/container/commits/master)
[](https://lifecycle.r-lib.org/articles/stages.html#stable)
# container
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
- Website: https://rpahl.github.io/r-some-blog/
- Twitter: romanpahl
- Repositories: 7
- Profile: https://github.com/rpahl
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
Top Committers
| Name | 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)
r-project.org: 1
gsk.com: 1
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
- Homepage: https://rpahl.github.io/container/
- Documentation: http://cran.r-project.org/web/packages/container/container.pdf
- License: GPL-3
-
Latest release: 1.0.5
published about 1 year ago
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