An open API service indexing awesome lists of open source software.

https://github.com/pepijn-devries/blosc

R package for compressing and decompressing data with BLOSC
https://github.com/pepijn-devries/blosc

Last synced: 3 months ago
JSON representation

R package for compressing and decompressing data with BLOSC

Awesome Lists containing this project

README

          

---
output: github_document
---

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

# BLOSC logo

[![R-CMD-check](https://github.com/pepijn-devries/blosc/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/pepijn-devries/blosc/actions/workflows/R-CMD-check.yaml)
[![version](https://www.r-pkg.org/badges/version/blosc)](https://CRAN.R-project.org/package=blosc)
[![cran checks](https://badges.cranchecks.info/worst/blosc.svg)](https://cran.r-project.org/web/checks/check_results_blosc.html)
[![R-universe version](https://pepijn-devries.r-universe.dev/blosc/badges/version)](https://pepijn-devries.r-universe.dev/blosc)
[![Codecov test coverage](https://codecov.io/gh/pepijn-devries/blosc/graph/badge.svg)](https://app.codecov.io/gh/pepijn-devries/blosc)

[Blosc](https://www.blosc.org/) is a blocking, shuffling and lossless compression
algorithm. It is often used to compress n-dimensional structured
array data. It is applied (among others) in the geo-spatial
[zarr](https://zarr.dev/) file format. This package ports BLOSC compressors and
decompressors to R.

## Installation

Install latest developmental version from R-Universe:

``` r
install.packages("blosc", repos = c('https://pepijn-devries.r-universe.dev', 'https://cloud.r-project.org'))
```

MacOS users may first need to install system requirements before installing the package using:

```r
source("https://mac.R-project.org/bin/install.R")
install.libs("blosc")
```

## Example

The blosc package can be used to compress `raw` data, but also vectors of
other data types. The example below shows how data from the volcano matrix
can be compressed with blosc.

```{r example1}
library(blosc)

volcano_compressed <-
blosc_compress(volcano, typesize = 2L, dtype = "