The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

grumpy

R-CMD-check Codecov test coverage

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 through {reticulate} 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:

install.packages("grumpy")

and the development version like so:

# install.packages("pak")
pak::pak("Bisaloo/grumpy")

Example

library(grumpy)
read_npy(system.file("extdata", "test_2d.npy", package = "grumpy"))
#>      [,1] [,2] [,3] [,4]
#> [1,]    0    3    6    9
#> [2,]    1    4    7   10
#> [3,]    2    5    8   11

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.