dibble

Dimensional Data Frames

https://github.com/uchidamizuki/dibble

Science Score: 26.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
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.6%) to scientific vocabulary

Keywords

multidimensional-arrays r tidy-data

Keywords from Contributors

strings gdal geos proj
Last synced: 6 months ago · JSON representation

Repository

Dimensional Data Frames

Basic Info
Statistics
  • Stars: 14
  • Watchers: 2
  • Forks: 2
  • Open Issues: 4
  • Releases: 6
Topics
multidimensional-arrays r tidy-data
Created about 4 years ago · Last pushed 9 months ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

Sys.setenv(LANGUAGE = "en")
```

# dibble


[![CRAN status](https://www.r-pkg.org/badges/version/dibble)](https://CRAN.R-project.org/package=dibble)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![R-CMD-check](https://github.com/UchidaMizuki/dibble/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/UchidaMizuki/dibble/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/UchidaMizuki/dibble/branch/main/graph/badge.svg)](https://app.codecov.io/gh/UchidaMizuki/dibble?branch=main)


A 'dibble' (derived from 'dimensional tibble') is a data frame consisting of arrays with dimension names, known as data cubes.
The columns of the dibbles are classified into dimensions or measures, and the operations on the measures are broadcasted by dimension names.

## Installation

``` r
# the released version from CRAN:
install.packages("dibble")

# the development version from GitHub:
# install.packages("devtools")
devtools::install_github("UchidaMizuki/dibble")
```

## Examples

```{r,message=FALSE,warning=FALSE}
library(dibble)
library(dplyr)
library(tidyr)
```

### Broadcasting
```{r}
arr1 <- array(1:6, c(2, 3), list(axis1 = letters[1:2], axis2 = letters[1:3]))
arr2 <- array(1:2, 2, list(axis2 = letters[1:2]))

try(arr1 * arr2)

ddf1 <- as_dibble(arr1)
ddf2 <- as_dibble(arr2)

ddf1 * ddf2
# You can use broadcast() to suppress the warnings.
broadcast(ddf1 * ddf2, dim_names = c("axis1", "axis2"))
```

### dplyr methods

dibble provides some dplyr methods as follows,

- `as_tibble()`: From tibble package
- `filter()`
- `mutate()`: Experimental
- `rename()`
- `select()` and `relocate()`
- `slice()`: Specify locations (a integer vector) for each dimension

### How to build a dibble

#### From a data.frame

```{r}
df <- expand_grid(axis1 = letters[1:2], axis2 = letters[1:2]) |>
  mutate(value1 = row_number(), value2 = value1 * 2)

ddf <- df |>
  dibble_by(axis1, axis2)
ddf
# You can access the measures from the dibble with `$`.
ddf$value1

df <- expand_grid(
  tibble(axis1_key = letters[1:2], axis1_value = 1:2),
  tibble(axis2_key = letters[1:2], axis2_value = 1:2)
) |>
  mutate(value1 = row_number(), value2 = value1 * 2)

# You can `pack` several columns into one dimension (See `tidyr::pack()`).
df |>
  dibble_by(
    axis1 = c(axis1_key, axis1_value),
    axis2 = c(axis2_key, axis2_value),
    .names_sep = "_"
  )
```

#### From an array with dimension names or a vector

dibble provides some dplyr methods as follows,

```{r}
# from an array with dimension names
arr <- array(1:4, c(2, 2), list(axis1 = letters[1:2], axis2 = letters[1:2]))

ddf1 <- as_dibble(arr)

# from a vector
ddf2 <- broadcast(1:4, list(axis1 = letters[1:2], axis2 = letters[1:2]))

arr
ddf1
ddf2
```

Owner

  • Name: Uchida Mizuki
  • Login: UchidaMizuki
  • Kind: user
  • Location: Japan
  • Company: Yachiyo Engineering Co., Ltd.

I am a classical music lover.

GitHub Events

Total
  • Create event: 4
  • Release event: 1
  • Issues event: 5
  • Watch event: 3
  • Delete event: 2
  • Issue comment event: 1
  • Push event: 16
  • Pull request event: 7
  • Fork event: 1
Last Year
  • Create event: 4
  • Release event: 1
  • Issues event: 5
  • Watch event: 3
  • Delete event: 2
  • Issue comment event: 1
  • Push event: 16
  • Pull request event: 7
  • Fork event: 1

Committers

Last synced: 10 months ago

All Time
  • Total Commits: 185
  • Total Committers: 3
  • Avg Commits per committer: 61.667
  • Development Distribution Score (DDS): 0.016
Past Year
  • Commits: 27
  • Committers: 2
  • Avg Commits per committer: 13.5
  • Development Distribution Score (DDS): 0.037
Top Committers
Name Email Commits
UchidaMizuki u****i@v****t 182
Hadley Wickham h****m@g****m 2
DavisVaughan d****s@r****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 18
  • Total pull requests: 15
  • Average time to close issues: 3 months
  • Average time to close pull requests: about 11 hours
  • Total issue authors: 1
  • Total pull request authors: 3
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.27
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 4
  • Pull requests: 7
  • Average time to close issues: about 5 hours
  • Average time to close pull requests: about 9 hours
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.14
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • UchidaMizuki (18)
Pull Request Authors
  • UchidaMizuki (18)
  • hadley (3)
  • DavisVaughan (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 563 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 7
  • Total maintainers: 1
cran.r-project.org: dibble

Dimensional Data Frames

  • Versions: 7
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 563 Last month
Rankings
Forks count: 17.8%
Stargazers count: 18.7%
Dependent packages count: 29.8%
Average: 31.3%
Dependent repos count: 35.5%
Downloads: 55.0%
Maintainers (1)
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • R >= 2.10 depends
  • dplyr * imports
  • memoise * imports
  • pillar * imports
  • purrr * imports
  • rlang * imports
  • tibble * imports
  • tidyr * imports
  • tidyselect * imports
  • vctrs * imports
  • covr * suggests
  • testthat >= 3.0.0 suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite