knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
An R package to run you R code in different R implementations and platforms in Docker containers.
You can install the development version from GitHub with:
# install.packages("remotes") remotes::install_github("ismailsunni/altRnative")
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 is created with roxygen2 and the website with pkgdown. Render both with the following commands:
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
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
:
#!/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
Please note that the 'altRnative' project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
This project is published under MIT license, see file LICENSE
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.