{"id":15048033,"url":"https://github.com/xtensor-stack/xtensor-r","last_synced_at":"2025-04-10T01:11:37.698Z","repository":{"id":43612288,"uuid":"93443748","full_name":"xtensor-stack/xtensor-r","owner":"xtensor-stack","description":"R bindings for xtensor","archived":false,"fork":false,"pushed_at":"2024-02-05T10:26:54.000Z","size":305,"stargazers_count":86,"open_issues_count":14,"forks_count":15,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-22T20:33:54.656Z","etag":null,"topics":["cpp14","ndarray","numpy","r","rlang","rstats"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xtensor-stack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-05T20:27:04.000Z","updated_at":"2024-08-22T10:44:02.000Z","dependencies_parsed_at":"2024-02-05T11:56:27.505Z","dependency_job_id":null,"html_url":"https://github.com/xtensor-stack/xtensor-r","commit_stats":{"total_commits":157,"total_committers":8,"mean_commits":19.625,"dds":0.4968152866242038,"last_synced_commit":"b92f69a6b93e3b30e4942cfba6a64855441102fa"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtensor-stack%2Fxtensor-r","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtensor-stack%2Fxtensor-r/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtensor-stack%2Fxtensor-r/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtensor-stack%2Fxtensor-r/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xtensor-stack","download_url":"https://codeload.github.com/xtensor-stack/xtensor-r/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137888,"owners_count":21053775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp14","ndarray","numpy","r","rlang","rstats"],"created_at":"2024-09-24T21:07:12.638Z","updated_at":"2025-04-10T01:11:37.670Z","avatar_url":"https://github.com/xtensor-stack.png","language":"C++","readme":"# ![xtensor-r](docs/source/xtensor-r.svg)\n\n[![Travis](https://travis-ci.org/xtensor-stack/xtensor-r.svg?branch=master)](https://travis-ci.org/xtensor-stack/xtensor-r)\n[![Appveyor](https://ci.appveyor.com/api/projects/status/xulke75tfifvnmj6?svg=true)](https://ci.appveyor.com/project/xtensor-stack/xtensor-r)\n[![Documentation](http://readthedocs.org/projects/xtensor-r/badge/?version=latest)](https://xtensor-r.readthedocs.io/en/latest/?badge=latest)\n[![Join the Gitter Chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/QuantStack/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nR bindings for the [xtensor](https://github.com/xtensor-stack/xtensor) C++ multi-dimensional array library.\n\n - `xtensor` is a C++ library for multi-dimensional arrays enabling numpy-style broadcasting and lazy computing.\n - `xtensor-r` enables inplace use of R arrays in C++ with all the benefits from `xtensor`\n\n     - C++ universal functions and broadcasting\n     - STL - compliant APIs.\n     - A broad coverage of numpy APIs (see [the numpy to xtensor cheat sheet](http://xtensor.readthedocs.io/en/latest/numpy.html)).\n\n`xtensor-r` can be used either to author C++ extensions for R with [Rcpp](https://github.com/RcppCore/Rcpp), or applications that embed the R interpreter with [RInside](https://github.com/eddelbuettel/rinside).\n\n## Example\n\n```cpp\n#include \u003cnumeric\u003e                    // Standard library import for std::accumulate\n#define STRICT_R_HEADERS              // Otherwise a PI macro is defined in R\n#include \"xtensor/xmath.hpp\"          // xtensor import for the C++ universal functions\n#include \"xtensor-r/rarray.hpp\"       // R bindings\n\n#include \u003cRcpp.h\u003e\n\nusing namespace Rcpp;\n\n// [[Rcpp::plugins(cpp14)]]\n\n// [[Rcpp::export]]\ndouble sum_of_sines(xt::rarray\u003cdouble\u003e\u0026 m)\n{\n    auto sines = xt::sin(m);  // sines does not actually hold values.\n    return std::accumulate(sines.cbegin(), sines.cend(), 0.0);\n}\n```\n\n```R\nv \u003c- matrix(0:14, nrow=3, ncol=5)\ns \u003c- sum_of_sines(v)\ns\n\n# prints 1.2853996391883833\n```\n\n## Installation\n\n### Installation of the standalone C++ library\n\n`xtensor-r` a header-only C++ library. It has been packaged for the mamba (or conda) package manager.\n\n```bash\nmamba install xtensor-r -c conda-forge\n```\n\n`xtensor-r` can be installed from source with cmake in any installation prefix. For example, on unix systems\n\n```bash\ncmake -D CMAKE_INSTALL_PREFIX=/prefix/path/ .\nmake\nmake install\n```\n\n### Installation of the R package\n\nWe provide a R package for Xtensor on both conda and CRAN (Comprehensive R Archive Network).\nThe packaging boilerplate for the R package is available at https://github.com/xtensor-stack/Xtensor.R.\n\nTo install the R package with conda:\n\n```bash\nconda install r-xtensor -c conda-forge\n```\n\nTo install the R package from CRAN:\n\n```bash\nR CMD INSTALL xtensor\n```\n\nor from the GitHub repository using devtools\n\n```R\ndevtools::install_github(\"xtensor-stack/Xtensor.R\")\n```\n\nThe CRAN package vendors the headers for `xtensor-r`, xtensor`, `xtl` and `xsimd`.\n\n## Documentation\n\nTo get started with using `xtensor-r`, check out the full documentation\n\nhttp://xtensor-r.readthedocs.io/\n\n## Dependencies on `xtensor` and `Rcpp`\n\n`xtensor-r` depends on the `xtensor` and `Rcpp` libraries\n\n| `xtensor-r`  | `xtensor` | `Rcpp`   |\n|--------------|-----------|----------|\n| master       |  ^0.25.0  | ^1.0     |\n| 0.15.0       |  ^0.25.0  | ^1.0     |\n| 0.14.2       |  ^0.24.4  | ^1.0     |\n| 0.14.1       |  ^0.24.0  | ^1.0     |\n| 0.14.0       |  ^0.24.0  | ^1.0     |\n| 0.13.0       |  ^0.23.0  | ^1.0     |\n| 0.12.1       |  ^0.21.4  | ^1.0     |\n| 0.12.0       |  ^0.21.2  | ^1.0     |\n\n - Core `xtensor` headers are vendored in the CRAN package.\n - When using the conda, or debian package managers, xtensor-r has a dependency on xtensor.\n\n## License\n\nWe use a shared copyright model that enables all contributors to maintain the copyright on their contributions.\n\nThis software is licensed under the BSD-3-Clause license. See the [LICENSE](LICENSE) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtensor-stack%2Fxtensor-r","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxtensor-stack%2Fxtensor-r","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtensor-stack%2Fxtensor-r/lists"}