https://github.com/ismailsunni/altrnative
An R package to run you R code in different R implementations and platforms on a docker container.
https://github.com/ismailsunni/altrnative
benchmark docker fastr mro pqr r renjin
Last synced: about 2 months ago
JSON representation
An R package to run you R code in different R implementations and platforms on a docker container.
- Host: GitHub
- URL: https://github.com/ismailsunni/altrnative
- Owner: ismailsunni
- License: mit
- Created: 2019-11-18T12:52:47.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-23T10:14:09.000Z (about 6 years ago)
- Last Synced: 2025-12-31T21:14:13.393Z (5 months ago)
- Topics: benchmark, docker, fastr, mro, pqr, r, renjin
- Language: R
- Size: 617 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# altRnative
[](https://www.tidyverse.org/lifecycle/#experimental)
[](https://travis-ci.org/ismailsunni/altRnative)
[](https://doi.org/10.5281/zenodo.3671405)
An R package to run you R code in different R implementations and platforms in [Docker]() containers.
## Installation
You can install the development version [from GitHub](https://github.com/ismailsunni/altRnative) with:
``` r
# install.packages("remotes")
remotes::install_github("ismailsunni/altRnative")
```
## Example
```{r example, cache=TRUE, results='hide', fig.width=8}
library('altRnative')
pull_docker_image(c('gnu-r', 'mro'), c('debian', 'ubuntu', 'fedora'))
benchmark_result = benchmarks_code(
code = "1 + 1",
r_implementations = c('gnu-r', 'mro'),
platforms = c('debian', 'ubuntu', 'fedora', 'archlinux'),
times = 3
)
library('ggplot2')
autoplot(benchmark_result)
```
## Documentation
Documentation is created with [roxygen2](https://roxygen2.r-lib.org/) and the website with [pkgdown](https://pkgdown.r-lib.org/).
Render both with the following commands:
```{r docs, eval=FALSE}
roxygen2::roxygenise(roclets = c('rd', 'collate', 'namespace', 'vignette'))
pkgdown::build_site()
```
The file `README.md` is generated from `README.Rmd`.
A [pre-commit hook]() added with [`usethis`](https://usethis.r-lib.org/reference/use_readme_rmd.html) should be configured to make sure the Markdown file is always up to date with the R Markdown file.
Add the following to a file `.git/hooks/pre-commit`:
```bash
#!/bin/bash
README=($(git diff --cached --name-only | grep -Ei '^README\.[R]?md$'))
MSG="use 'git commit --no-verify' to override this check"
if [[ ${#README[@]} == 0 ]]; then
exit 0
fi
if [[ README.Rmd -nt README.md ]]; then
echo -e "README.md is out of date; please re-knit README.Rmd\n$MSG"
exit 1
elif [[ ${#README[@]} -lt 2 ]]; then
echo -e "README.Rmd and README.md should be both staged\n$MSG"
exit 1
fi
```
## Contribute
Please note that the 'altRnative' project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md).
By contributing to this project, you agree to abide by its terms.
## License
This project is published under MIT license, see file `LICENSE`.