https://github.com/dcooley/interleave
https://github.com/dcooley/interleave
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dcooley/interleave
- Owner: dcooley
- License: other
- Created: 2020-05-05T00:19:11.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-02T14:46:42.000Z (over 2 years ago)
- Last Synced: 2025-02-01T21:11:07.538Z (over 1 year ago)
- Language: C++
- Size: 1.04 MB
- Stars: 10
- Watchers: 4
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
editor_options:
chunk_output_type: console
---
[](https://github.com/dcooley/interleave/actions)
[](https://app.codecov.io/gh/dcooley/interleave?branch=master)
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#",
fig.path = "man/figures/README-",
out.width = "100%"
)
library(interleave)
```
```{r, echo = FALSE, out.height="256px", out.width="256px"}
knitr::include_graphics("./man/figures/interleaving.gif")
```
# interleave
As the amazing gif shows, **interleaving** in this context means converting a matrix into a vector, filled in a row-wise manner.
I'm building this library to be the workhorse for converting matrices (and lists of matrices) into single, interleaved vectors, ready for WebGL applications.
Here are some simple examples
```{r}
( mat1 <- matrix(1:20, ncol = 2, byrow = T) )
interleave( mat1 )
( mat2 <- matrix(20:1, ncol = 5, byrow = T) )
interleave( mat2 )
lst <- list( mat1, mat2 )
interleave( lst )
```