https://github.com/neurogenomics/templateR
Self-updating template for developing R packages.
https://github.com/neurogenomics/templateR
bioconductor cran-r documentation github-actions r r-package templates
Last synced: 6 months ago
JSON representation
Self-updating template for developing R packages.
- Host: GitHub
- URL: https://github.com/neurogenomics/templateR
- Owner: neurogenomics
- Created: 2021-12-17T13:23:10.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-12-09T18:26:33.000Z (over 1 year ago)
- Last Synced: 2024-08-13T07:11:16.662Z (10 months ago)
- Topics: bioconductor, cran-r, documentation, github-actions, r, r-package, templates
- Language: R
- Homepage: https://neurogenomics.github.io/templateR/
- Size: 2.27 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
- jimsghstars - neurogenomics/templateR - Self-updating template for developing R packages. (R)
README
---
title: "`r read.dcf('DESCRIPTION', fields = 'Package')[1]`"
author: "`r rworkflows::use_badges()`"
date: "README updated: `r format( Sys.Date(), '%b-%d-%Y')`
"
output:
github_document
---```{r, echo=FALSE, include=FALSE}
pkg <- read.dcf("DESCRIPTION", fields = "Package")[1]
title <- gsub("\n"," ",read.dcf("DESCRIPTION", fields = "Title")[1])
description <- gsub("\n"," ",read.dcf("DESCRIPTION", fields = "Description")[1])
URL <- read.dcf('DESCRIPTION', fields = 'URL')[1]
owner <- strsplit(URL,"/")[[1]][4]
repo <- strsplit(URL,"/")[[1]][5]
```
**\<---⬇️⬇️⬇️(Start of section that can be deleted after forking the template)⬇️⬇️⬇️---\>**## Citation
If you use the `templateR` R package template,
or any of the [`rworkflows`](https://github.com/neurogenomics/rworkflows) suite tools,
please cite:> Brian M. Schilder, Alan E. Murphy, & Nathan G. Skene (2023) The rworkflows suite: automated continuous integration for quality checking, documentation website creation, and containerised deployment of R packages, Research Square; https://doi.org/10.21203/rs.3.rs-2399015/v1
## Setup
`templateR` is a template designed to make developing new R packages easy by providing:
- **DESCRIPTION, vignettes/, tests/, R/, man/, inst/**: Basic skeleton for the package itself.
- **README.Rmd**: Auto-populates based on the *DESCRIPTION* file (that can be knit to create *README.md*). Also contains [badges](https://github.com/GuangchuangYu/badger) that automatically update themselves.
- **inst/hex/hexSticker.Rmd**: Template for creating [hex stickers](https://github.com/GuangchuangYu/hexSticker).
- **.github/workflows/\*.yml**: [GitHub Actions](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions) workflow files that will automatically trigger code checks and pushing images to [DockerHub](https://hub-stage.docker.com/) every time you make a push to your GitHub repo (from [`rworkflows`](https://github.com/neurogenomics/rworkflows)).
- **inst/CITATION** : Allows users of your package to call `citation("")`. Also used to auto-populate the *README.Rmd*.
To get started, simply click on the green **Use this template** button
at the top right of the `templateR` repo.### GitHub Secrets
To use certain features of `rworkflows`, you may need to set up one or more [GitHub Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets):
- `PAT_GITHUB` [Optional]: Can grant access to private repos on GitHub
Actions. You can generate your very own Personal Authentication Token
with `usethis::create_github_token()`. See the [GitHub
docs](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
for details.
- `DOCKER_TOKEN` [Optional]: Allows GitHub Actions to push to a
[DockerHub](https://hub.docker.com) account.
### GitHub PagesThe [GitHub Actions](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions) workflows included in this template will automatically create a documentation website for your package via [GitHub Pages](https://pages.github.com/).
After the **`rworkflows` action** has successfully run on Ubuntu for the
first time, a new branch will appear in your repo called "gh-pages".**\<---⬆️⬆️⬆️(End of section that can be deleted after forking the template)⬆️⬆️⬆️---\>**
## ``r pkg``: `r gsub("\n","",title)`
### `r gsub("\n","",description)`
If you use ``r pkg``, please cite:> `r utils::citation(pkg)$textVersion`
## Installation
```R
if(!require("remotes")) install.packages("remotes")remotes::install_github("`r paste(owner,repo,sep='/')`")
library(`r pkg`)
```
## Documentation### [Website](https://`r owner`.github.io/`r repo`)
### [Getting started](https://`r owner`.github.io/`r repo`/articles/`r pkg`)
## Session Info
```{r}
utils::sessionInfo()
```