green-digital-skills-r
This is a demonstration of the implementation of Green Code (python) in R-based workflows to measure the energy consumption of individual snippets of code, scripts, and rendered documents (i.e., Rmd/QMD). This work is an extension to the pilot Green Digital Skills workshop by the Netherlands eScience center.
Science Score: 44.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
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.1%) to scientific vocabulary
Repository
This is a demonstration of the implementation of Green Code (python) in R-based workflows to measure the energy consumption of individual snippets of code, scripts, and rendered documents (i.e., Rmd/QMD). This work is an extension to the pilot Green Digital Skills workshop by the Netherlands eScience center.
Basic Info
- Host: GitHub
- Owner: javimangal
- License: mit
- Language: HTML
- Default Branch: main
- Size: 370 KB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
This repository is deprecated. All relevant content has been migrated an is maintained in: https://github.com/UtrechtUniversity/code-carbon-r
Green Digital Skills with R
This is a demonstration of the implementation of Green Code (python) in R-based workflows to measure the energy consumption of individual snippets of code, scripts, and rendered documents (i.e., Rmd/qmd). This work is an extension to the pilot Green Digital Skills workshop by the Netherlands eScience center.
Usage
The suggested use of this repository starts with making sure that R, RStudio, and python are installed in your computer:
1. Install R and RStudio
Install R and RStudio on your computer if you haven't done so. Note that these demonstrations were conducted under R version 4.4.0 and RStudio 2024.04.0.
2. Install Python and CodeCarbon
Detailed instructions are provided here.
3. Download the material
There are several ways to download the necessary material:
The simplest way is to download the ZIP file, unpack it, and place it in a familiar folder in your computer.
GitHub desktop is also a good option to copy this repository by following these instructions.
You should now have all the necessary files in your computer with an identical folder structure (described in the following section).
4. Open the project in RStudio
In the main directory, open the file named green-digital-skills-r.Rproj in RStudio. This will open RStudio in the default working directory of the project. You can now navigate through the folders on the right-bottom panel of R Studio.
Open the R folder. You should now see a series of files ending with .qmd (markdown document with embedded R and python code) and .R (these are conventional R scripts). From here, there are three main ways of using CodeCarbon in your R workflow.
5. Running CodeCarbon in R scripts
There is a sample R script you can reuse and adapt to test your code. Open the file code-carbon-script.R in the R folder.
🚧 This section is under construction. Stay tuned!
Project Structure
The project structure distinguishes three kinds of folders:
- read-only (RO): not edited by either code or researcher
- human-writeable (HW): edited by the researcher only.
- project-generated (PG): folders generated when running the code; these folders can be deleted or emptied and will be completely reconstituted as the project is run.
.
├── .gitignore
├── CITATION.cff
├── LICENSE
├── README.md
├── green-digital-skills-r.Rproj
├── docs <- Documentation notebook for users (HW)
└── R <- Source code for this project (HW)
Contact
You can contact me or post a request in this repository in case you encounter any issues.
License
This project is licensed under the terms of the MIT License.
This project structure repository is adapted from the Utrecht University simple R project template, which builds upon the Good Enough Project Cookiecutter template by Barbara Vreede (2019).
Owner
- Name: Javier Mancilla Galindo
- Login: javimangal
- Kind: user
- Location: Utrecht, Netherlands
- Company: @UtrechtUniversity
- Twitter: Javimangal
- Repositories: 1
- Profile: https://github.com/javimangal
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: Green Digital Skills with R
message: >-
This is a demonstration of the implementation of Green
Code (python) in R-based workflows to measure the energy
consumption of individual snippets of code, scripts, and
rendered documents (i.e., Rmd/QMD). This work is an
extension to the pilot Green Digital Skills workshop by
the Netherlands eScience center.
type: software
authors:
- given-names: Javier
family-names: Mancilla Galindo
email: j.mancillagalindo@uu.nl
affiliation: >-
Institute for Risk Assessment Sciences, Utrecht
University
orcid: 'https://orcid.org/0000-0002-0718-467X'
repository-code: 'https://github.com/javimangal/green-digital-skills-r'
repository: >-
https://github.com/esciencecenter-digital-skills/green-digital-skills
keywords:
- green coding
- code carbon
- R
- python
- Quarto
license: MIT
GitHub Events
Total
- Push event: 5
- Create event: 1
Last Year
- Push event: 5
- Create event: 1
Issues and Pull Requests
Last synced: 11 months 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