README.md

readmat

R-CMD-check Project Status: Concept – Minimal or no implementation has been done
yet, or the repository is only intended to be a limited example, demo,
or
proof-of-concept. license Last-changedate

Readmat requires a full license and installation of Matlab(R) if you don’t have this then the R.matlab (Bengtsson 2018) package is much more suitable. The only goal of this package is to provide a potentially faster approach, especially when dealing with large matrices.

This package is definitely under development!

Benchmark

A data cube of 400 x 400 x 400 values.

readmat::read_mat(readmat::get_matlab("double-large-cube.mat"))[[1]] |> 
  dim()
#> 1 object(s) found in this MAT file. 
#> Object has 3 dimensions of size: 400, 400, 400, with type: double.
#> [1] 400 400 400

Comparing R.matlab and readmat.

| package | min | median | itr/sec | mem_alloc | n_itr | n_gc | total_time | |:---------|-----:|-------:|--------:|----------:|------:|-----:|-----------:| | R.matlab | 3.31 | 3.36 | 1.00 | 3.98 | 10 | 0 | 27.775926 | | readmat | 1.00 | 1.00 | 3.33 | 1.00 | 5 | 5 | 4.173084 |

Installation

You can install the development version of readmat from GitHub with:

# install.packages("devtools")
devtools::install_github("MartinSchobben/readmat")

Credits

The construction of the R (R Core Team 2022) package readmat and associated documentation was aided by the packages; devtools (Wickham et al. 2021) and cpp11 (Hester and François 2021).

References

Bengtsson, Henrik. 2018. *R.matlab: Read and Write MAT Files and Call MATLAB from Within r*. .
Hester, Jim, and Romain François. 2021. *Cpp11: A c++11 Interface for r’s c Interface*. .
R Core Team. 2022. *R: A Language and Environment for Statistical Computing*. Vienna, Austria: R Foundation for Statistical Computing. .
Wickham, Hadley, Jim Hester, Winston Chang, and Jennifer Bryan. 2021. *Devtools: Tools to Make Developing r Packages Easier*. .


MartinSchobben/readmat documentation built on May 22, 2022, 11:44 a.m.