Interface to 'Geomstats'

Provides an interface to the Python package 'Geomstats' authored by Miolane et al. (2020) .


rgeomstats

check-standard test-coverage Codecov testcoverage pkgdown CRANstatus

The goal of rgeomstats is to provide accessibility to the Geomstats Python library for the community of R users through an R interface that mimics as closely as possible the carefully designed Python API.

Installation

You can install the development version of rgeomstats via:

# install.packages("remotes")
remotes::install_github("LMJL-Alea/rgeomstats")

Example

You can instantiate the space $\mathrm{SO}(3)$ of 3D rotations and sample random points in this space as follows:

library(rgeomstats)
so3 <- SpecialOrthogonal(n = 3)
spl <- so3$random_point(n_samples = 5)
dim(spl)
#> [1] 5 3 3

All Geomstats-like computations are stored in arrays. In particular, sample IDs are always stored along the first dimension. Hence, it is always possible to convert a sample into a list via:

purrr::array_tree(spl, margin = 1)
#> [[1]]
#>             [,1]       [,2]      [,3]
#> [1,] -0.03532813 -0.9154660 0.4008416
#> [2,]  0.68066355  0.2716386 0.6803746
#> [3,] -0.73174384  0.2968746 0.6135278
#> 
#> [[2]]
#>            [,1]          [,2]      [,3]
#> [1,] -0.3117327 -0.8280555376 0.4659901
#> [2,]  0.8305219  0.0007836864 0.5569855
#> [3,] -0.4615801  0.5606455319 0.6874739
#> 
#> [[3]]
#>            [,1]        [,2]       [,3]
#> [1,] -0.7025064  0.66878384 -0.2433370
#> [2,] -0.3513459 -0.02856766  0.9358098
#> [3,]  0.6189029  0.74290785  0.2550434
#> 
#> [[4]]
#>            [,1]       [,2]       [,3]
#> [1,] -0.8970871 -0.2258339  0.3797811
#> [2,] -0.1157827 -0.7093377 -0.6952945
#> [3,]  0.4264141 -0.6677119  0.6101900
#> 
#> [[5]]
#>            [,1]       [,2]       [,3]
#> [1,] -0.3877247 -0.3760100 -0.8415973
#> [2,]  0.4484487 -0.8746292  0.1841673
#> [3,] -0.8053343 -0.3060069  0.5077366

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("rgeomstats")

0.0.1 by Aymeric Stamm, 4 years ago


https://github.com/LMJL-Alea/rgeomstats, https://lmjl-alea.github.io/rgeomstats/


Report a bug at https://github.com/LMJL-Alea/rgeomstats/issues


Browse source code at https://github.com/cran/rgeomstats


Authors: Aymeric Stamm [aut, cre] , Nicolas Guigui [ctb] (Author of the Geomstats Python package , , Alice Le Brigant [ctb] (Author of the Geomstats Python package , , Johan Mathe [ctb] (Author of the Geomstats Python package) , Nina Miolane [ctb] (Author of the Geomstats Python package , , Xavier Pennec [ctb] (Author of the Geomstats Python package , , Luis Pereira [ctb] (Author of the Geomstats Python package) , Yann Thanwerdas [ctb] (Author of the Geomstats Python package ,


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports cli, purrr, R6, Rdpack, reticulate, rlang

Suggests testthat


Imported by nevada.


See at CRAN