Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/public-health-scotland/r-project-structure
A template for R projects
https://github.com/public-health-scotland/r-project-structure
template
Last synced: 5 days ago
JSON representation
A template for R projects
- Host: GitHub
- URL: https://github.com/public-health-scotland/r-project-structure
- Owner: Public-Health-Scotland
- Created: 2018-03-28T14:09:17.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-18T13:22:20.000Z (about 4 years ago)
- Last Synced: 2024-08-13T07:14:11.040Z (3 months ago)
- Topics: template
- Language: R
- Homepage:
- Size: 139 KB
- Stars: 9
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# *Title of project*
*Description of project*### Directories
* `code` - R scripts required for project
+ `code.R` - example structure for main R script(s)
+ `functions.R` - functions sourced and used in main script(s)
+ `packages.R` - list of packages sourced and used in main script(s)
* `data` - data required for project
+ `basefiles`
+ `output`
+ `temporary`### Files
* `.Renviron` - R environment
* `.Rprofile` - R profile settings
* `.gitignore` - tells git what files and folders *not* to track or upload to GitHub
* `README.md` - this page
* `r-project.Proj` - R project
## How to useTo use this template, download the repository as a zip file and save it to your local network.
You can then edit the files and folders accordingly, e.g. rename the project or R script files and update the README with a project description and contents.This template aims to instil best practice within PHI and therefore git has been
initiliased for version control. However, if you are not
using this then you can delete the .gitignore file. More information about [version control](https://github.com/Public-Health-Scotland/resources/blob/master/version-control.md).If you are using git for version control then please be aware that the .gitignore contains the minimum recommended file types and folders to stop data being tracked and pushed to GitHub. Further guidance on using git and GitHub securely can be found [here](https://github.com/Public-Health-Scotland/GitHub-guidance).
This template is also intended to be flexible, so you may not require every file or folder. For example, if you have written long or multiple functions then we would recommend saving these in the dedicated `functions.R` file, which can then be sourced within the main script(s). Additionally, if you are using many packages then these could be saved within the `packages.R` file and sourced similarly. However, decisions on the exact structure of the folders and scripts should be left up to the analyst's discretion. For more information on structuring and writing R scripts see the [PHI R Style Guide](https://github.com/Public-Health-Scotland/R-Resources/blob/master/PHI%20R%20style%20guide.md).