-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathREADME.qmd
More file actions
58 lines (43 loc) · 1.93 KB
/
Copy pathREADME.qmd
File metadata and controls
58 lines (43 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
format:
gfm:
default-image-extension: ""
---
<!-- README.md is generated from README.qmd. Please edit that file -->
```{r}
#| include: false
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# grumpy
<!-- badges: start -->
[](https://github.com/Bisaloo/grumpy/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/gh/Bisaloo/grumpy)
<!-- badges: end -->
The `{grumpy}` R package provides a way to read NumPy's `.npy` files into R. It supports a wide range of data types and array shapes.
As a file format generated by a Python package, `.npy` files are prime candidates for using the `{reticulate}` package to read them into R.
However, using a Python package in R comes with downsides in terms of:
- performance, since the data needs to be copied across languages / sessions
- flexibility, since reticulate makes opinionated choices to work out of the box for most use cases
- robustness, since packages depending on reticulate need to risk breaking changes in the python packages they now depend on, or need to provide an environment via `{basilisk}`.
`{grumpy}`, on the other hand, is a pure R package with no dependency and is performant, flexible. Overall, it is designed to be used deep in the dependency graph of other packages.
For more details on the motivation and design principles underpinning `{grumpy}`, see the dedicated vignette: `vignette("design", package = "grumpy")`.
## Installation
You can install the released version of grumpy with:
``` r
install.packages("grumpy")
```
and the development version like so:
``` r
# install.packages("pak")
pak::pak("Bisaloo/grumpy")
```
## Example
```{r}
library(grumpy)
read_npy(system.file("extdata", "test_2d.npy", package = "grumpy"))
```