rtemplate
Template to build R package with github actions CI/CD, tests, codecov and docs.
Science Score: 28.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
1 of 2 committers (50.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.5%) to scientific vocabulary
Repository
Template to build R package with github actions CI/CD, tests, codecov and docs.
Basic Info
- Host: GitHub
- Owner: JGCRI
- License: other
- Language: TeX
- Default Branch: main
- Homepage: https://jgcri.github.io/rtemplate/
- Size: 10.6 MB
Statistics
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Introduction
rtemplate is a template for creating a basic R package with Continuous Integration (CI) via GitHub actions in the following steps:
The folder structure is as shown below:
1 Clone or "Use this template"
Navigate directly to https://github.com/JGCRI/rtemplate, click the shiny green button that says Use this template and be on your way.
You can also clone the template to view the files locally and then copy into your own repo as needed:
bash
git clone https://github.com/JGCRI/rtemplate.git
2 Update Package Information
Update your information (package name and other details) in the following files:
- README.md
- DESCRIPTION
- LICENSE
3 Update Package Modules
This is where you write the main code for your model. We have include some key modules and tests. You should write tests for all your modules as you develop them.
- R\rtemplate.R (This defines your package and provides the help/documentation for the package.)
- R\example_function.R (This is an example function with documentation. You can copy this to create other functions.)
4 Update Tests
We provide a sample test file that should be updated as you add in new modules and classes. These tests are linked to the GitHub Action so that every time you push any changes your tests are executed. The GitHub action also links to codecov so that you know how much of your code is covered by the tests you have written. You should aim to keep this percentage to above 70%.
- tests\testthat.R (Update package name here)
- tests\testthat\test-rtemplate.R (Write unit and integration tests for each of your functions here.)
5 Update Package Documentation
Update each of the following files to generate clean, clear documentation. When you push your changes to github the github actions described in the next section will automatically build the documentation page online for you. An example for this repo is available at: https://jgcri.github.io/rtemplate/.
- _pkgdown.yml
- CITATION.md
- CONTRIBUTE.md
- DISCLAIMER
- LICENSE
- NEWS.md
- SUPPORT.md
Once your GitHub action for docs is complete (see section 6 GitHub Actions) you need the following steps to get your documentation page live online:
6 Github Actions
The final piece is to check your GitHub actions for continuous integration. These actions have been written so they are trigger everytime you push to main or execute a pull request to main. There are four GitHub actions included with this package as follows:
- .github\workflows\build.yml (Tests if package builds on windows, macos, ubuntu)
- .github\workflows\docs.yml (Automatically builds your documentation from the vignette folder and hosts on GitHub pages)
- .github\workflows\test.yml (Runs your tests and check what percentage is covered on codecov. You will need to connect your repository to codecoverage for this to work as shown below.)
The final step is to add your badges to your repository as follows. Simply replace "rtemplate" with your own repo name in the following three badges and then paste these at the top of the README.md file and push:
[](https://github.com/JGCRI/rtemplate/actions/workflows/build.yml)
[](https://github.com/JGCRI/rtemplate/actions/workflows/docs.yml)
[](https://github.com/JGCRI/rtemplate/actions/workflows/test.yml)
For the codecoverage badge use the Markdown badge you copied from codecov as shown in the final step above.
Owner
- Name: Joint Global Change Research Institute
- Login: JGCRI
- Kind: organization
- Location: College Park, MD, USA
- Website: https://www.pnnl.gov/projects/jgcri
- Repositories: 129
- Profile: https://github.com/JGCRI
Advancing fundamental understanding of human and Earth systems
Citation (CITATION.md)
<!-------------------------->
<!-------------------------->
# Citation
<!-------------------------->
<!-------------------------->
Author, I., 2022. rtemplate: A template to build R packages using GitHub Actions for CI/CD, testing, code coverage, and documentation. (In progress) Journal, DOI: XXXX
<!-------------------------->
<!-------------------------->
# BibText
<!-------------------------->
<!-------------------------->
```
@article{snyder2022osiris,
title={A template to build R packages using GitHub Actions for CI/CD, testing, code coverage, and documentation},
author = {First Last1 and First Last2},
year = {2022},
note = {In Progress},
url = {https://github.com/JGCRI/rtemplate},
doi = {xxx},
journal={Journal}
}
```
GitHub Events
Total
- Watch event: 2
- Fork event: 1
Last Year
- Watch event: 2
- Fork event: 1
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Zarrar Khan | z****n@p****v | 13 |
| Zarrar Khan | z****5@g****m | 2 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: over 2 years ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0



