-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
91 lines (68 loc) · 2.67 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# altRnative
<!-- badges: start -->
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![Travis build status](https://travis-ci.org/ismailsunni/altRnative.svg?branch=master)](https://travis-ci.org/ismailsunni/altRnative)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3671405.svg)](https://doi.org/10.5281/zenodo.3671405)
<!-- badges: end -->
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`.