-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
87 lines (57 loc) · 4.37 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
---
title: "`r read.dcf('DESCRIPTION', fields = 'Package')[1]`"
author: "`r rworkflows::use_badges()`"
date: "<h4>README updated: <i>`r format( Sys.Date(), '%b-%d-%Y')`</i></h4>"
output:
github_document
---
<!-- To modify Package/Title/Description/Authors fields, edit the DESCRIPTION file -->
```{r, echo=FALSE, include=FALSE}
pkg <- read.dcf("DESCRIPTION", fields = "Package")[1]
title <- read.dcf("DESCRIPTION", fields = "Title")[1]
description <- 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)---\>*
## 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 [`r_workflows`](https://github.com/neurogenomics/r_workflows)).
- **inst/CITATIONS** : Allows users of your package to call `citation("<packageName>")`. 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
Before pushing changes to your new R package,
you will need to add two [GitHub Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets):
1. `PAT_GITHUB`: Speeds up installations and gives access to private repos on GitHub Actions. You can generate your very own Personal Authentication Token using [these instructions](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).
2. `CODECOV_TOKEN`: Allows [code coverage](https://app.codecov.io/) results to be displayed via the `rworkflows::use_badges()` at the top of the *README.Rmd*. This [Codecov](https://app.codecov.io/) token is repository-specific and can be found [here](https://app.codecov.io/gh/`r owner`/`r pkg`).
3. `DOCKER_TOKEN`: Allows GitHub Actions to push to the [neurogenomicslab DockerHub](https://hub.docker.com/orgs/neurogenomicslab) account. Ask a fellow [Neurogenomics Lab](https://www.neurogenomics.co.uk/) member for this token.
### GitHub Pages
The [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/). This requires several initial setup steps (you only need to do these once per repo):
1. After *check-bioc-docker.yml* has successfully run on Ubuntu for the first, a new branch will appear in your repo called "gh-pages".
2. In the **Settings** tab of your repo, go to **Pages** on the left. Then under **Source** select `"branch: gh-pages"` and `"root"` from the respective dropdown menus. Finally, click the **Save** button.
*Note*: If you don't have admin access to your repo, you will need to ask someone who does to change this for you.
*\<---(End of section that can be deleted after forking the template)---\>*
# Introduction
This Repository contains code and simulation for Three way test in submitted paper.
## ``r pkg``: `r title`
### `r description`
If you use ``r pkg``, please cite:
<!-- Modify this by editing the file: inst/CITATION -->
> `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`)
<hr>
## Contact
For any more detailed questions, please contact: [email protected]
<br>