This package provides access to the
cnpy library by Carl Rogers
which provides read and write facilities for files created with (or for) the
NumPy extension for Python.
Support is currently limited to reading and writing of either vectors
or matrices of numeric types. Integer support can be added if the
package, as well Rcpp are recompiled using the
gzip compression can be transparently read and
written as well.
1 2 3
string with (path and) filename for a
string with type 'numeric' (default) or 'integer'. Integer
support is available only if Rcpp and RcppCNPy have been compiled
an R object, currently limited to a vector or matrix of either integer or numeric type
a boolean variable indicating whether a two-dimensional object should be transposed after reading, default is yes
a one-character string indicating whether files are
appended to ("a") or written ("w", the default). In case of writing
The package uses Rcpp modules to provide R bindings
npySave() which wrap the
npy_save() functions. Currently, only one- and two-dimensional
vectors and matrices are suppported; higher-dimensional arrays could
Dirk Eddelbuettel provided the binding to R (using the Rcpp package).
Carl Rogers wrote the underlying
cnpy library, which is
released under the MIT license.
Maintainer: Dirk Eddelbuettel <[email protected]>
Rcpp, in particular the Rcpp modules documentation.
cnpy repository: https://github.com/rogersce/cnpy
## TODO, but see demo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.