https://github.com/multimeric/altrepr
Tools for exploring and working with ALTREP objects in R
https://github.com/multimeric/altrepr
altrep r
Last synced: 9 months ago
JSON representation
Tools for exploring and working with ALTREP objects in R
- Host: GitHub
- URL: https://github.com/multimeric/altrepr
- Owner: multimeric
- License: other
- Created: 2023-04-08T15:13:01.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-08-28T23:41:52.000Z (over 2 years ago)
- Last Synced: 2025-04-03T13:21:22.993Z (12 months ago)
- Topics: altrep, r
- Language: C++
- Homepage: https://multimeric.github.io/altrepr
- Size: 579 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
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 = "100%"
)
```
# altrepr
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[](https://CRAN.R-project.org/package=altrepr)
`altrepr` shines light on the enigmatic ALTREP (Alernate Representation) objects in R.
It offers:
* Inspection of ALTREP types
* Specialized constructors and inspections for the 4 built-in ALTREP classes in R
* Detailed vignettes that explore these classes, how to use them in R, and
their internal workings
## Installation
You can install the development version of altrepr like so:
``` r
remotes::install_github("multimeric/altrepr")
```
## Example
```{r example}
library(altrepr)
```
`1:5` is just a normal integer vector right? Wrong! It's a sneaky ALTREP
masquerading as an integer vector.
```{r}
x <- 1:5
is_altrep(x)
```
With `altrepr` we can dig into the details:
```{r}
alt_details(x)
```
```{r}
compact_details(x)
```
And, if we're feeling brave, we can even edit the ALTREP:
```{r}
set_alt_data1(x, c(10, 1, 1))
x
```
For more information, refer to the detailed vignettes!