Skip to content

Commit

Permalink
Merge pull request #4 from cct-datascience/gh-actions
Browse files Browse the repository at this point in the history
Use GitHub actions to automate publishing
  • Loading branch information
Aariq authored Aug 21, 2023
2 parents d335a67 + f186378 commit feb0b70
Show file tree
Hide file tree
Showing 119 changed files with 12,949 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
28 changes: 28 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#Source: https://quarto.org/docs/publishing/github-pages.html#github-action
#NOTE: this won't execute R code, so if there is R code in the website content,
# you'll have to run `quarto render` locally before pushing to GitHub
on:
workflow_dispatch:
push:
branches: main

name: Quarto Publish

jobs:
build-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2

- name: Render and Publish
uses: quarto-dev/quarto-actions/publish@v2
with:
target: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 14 additions & 0 deletions _freeze/index/execute-results/html.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"hash": "f67018b60844a5db5bc7535656eb1efd",
"result": {
"markdown": "---\ntitle: \"Reproducibility & Data Science in R\"\nsubtitle: \"Session 1\"\n# date: TODO\nformat: revealjs\nexecute: \n echo: true\nengine: knitr\nchalkboard: true\nfooter: \"[Reproduciblity & Data Science in R](https://cct-datascience.github.io/repro-data-sci/)\"\n---\n\n\n## What is Reproducibility & Why?\n\n\n```{=html}\n<textarea id=\"freeform\" name=\"freeform\" rows=\"8\" cols=\"60\" style=\"font-size: 18pt\">\nReproducibility is...\n\n</textarea>\n```\n\n```{=html}\n<textarea rows=\"8\" cols=\"60\" style=\"font-size: 18pt\">\nI want my work to be reproducible because...\n\n</textarea>\n```\n\n## \n\n[![By The Turing Way Community](https://the-turing-way.netlify.app/_images/reproducible-matrix.jpg)](https://the-turing-way.netlify.app/reproducible-research/overview/overview-definitions)\n\n## The Whole Picture\n\n::: callout-note\n## A (usually fiction) story:\n\nYou read a great paper and think \"I bet I could apply their analysis methods to my work!\" You click a DOI link in their Data Availability section that they definitely have.\nIt opens to a web page where you can download a folder with R code, data, and documentation about the code and data.\nThe page also has detailed information about how to cite the code and data.\nYou open the folder in R Studio and you are prompted to install all the packages you need to run the code.\nYou open the analysis code script and hit \"run\".\nAll the code runs perfectly with no errors, creating all the figures, tables, and statistics used in the paper.\nYou scroll through the well-formatted R code and understand from the authors' comments exactly what the code does and how to adapt it to your work.\n:::\n\n. . .\n\nWe want to help you make this story a reality for someone else!\n\n::: notes\nIncluding future you!\n:::\n\n## Syllabus & Workshop Materials\n\nWorkshop series website:\\\n<https://cct-datascience.github.io/repro-data-sci/>\n\n## Screen Setup {{< fa desktop >}} {{< fa laptop >}}\n\n- Dual monitors will be *very* helpful\n- Virtual desktops (\"Spaces\" in macOS) also helpful\n- Let us know if you do not have access to a second monitor\n\n![](desk.jpg){fig-alt=\"Photo of a desk with a laptop on a laptop stand to the left and a larger monitor to the right in front of an external keyboard. Laptop monitor has Zoom open and the larger monitor has RStudio open.\" fig-align=\"center\"}\n\n## Settings for Success\n\n::: columns\n::: {.column width=\"60%\"}\n![](rstudio-settings.png){fig-alt=\"image of RStudio global settings pane with the \\\"Workspace\\\" and \\\"History\\\" sections highlighted. None of the boxes are checked and the dropdown for \\\"Save workspace to .RData on exit\\\" is set to \\\"never\\\"\" fig-align=\"left\"}\n:::\n\n::: {.column width=\"40%\"}\n::: incremental\n- Fresh start ensures reproducibility\n\n- Use Session \\> Restart R to check reproducibility\n\n- If long-running code is a concern, there are better solutions\n:::\n:::\n:::\n\n## Project Management\n\n![](https://swcarpentry.github.io/r-novice-gapminder/fig/bad_layout.png)\n\n::: notes\nThere are many reasons why we should *ALWAYS* avoid this:\n\n1. It is really hard to tell which version of your data is the original and which is the modified;\n2. It gets really messy because it mixes files with various extensions together;\n3. It probably takes you a lot of time to actually find things, and relate the correct figures to the exact code that has been used to generate it;\n\nA good project layout will ultimately make your life easier:\n\n- It will help ensure the integrity of your data;\n- It makes it simpler to share your code with someone else (a lab-mate, collaborator, or supervisor);\n- It allows you to easily upload your code with your manuscript submission;\n- It makes it easier to pick the project back up after a break.\n:::\n\n## Creating a Research Compendium with R\n\nLearning Objectives:\n\n1. Use RStudio projects to create self-contained reproducible projects\n2. Use best practices for organizing files in a project\n3. Use relative file paths to improve portability of projects\n4. Structure R scripts so they are easier to understand\n\n## Takeaways\n\n- Structure files in self-contained projects or \"research compendia\"\n- Put data in a separate folder and never edit raw data!\n- Avoid `setwd()` and `getwd()`---use relative paths and RStudio projects instead\n- Naming things well is difficult but worth spending time on\n- Use some consistent style in your code and organize scripts in sections\n- Split long scripts into multiples and use `source()` to run them if needed'\n\n## Homework (optional)\n\nRe-organize an existing project into a research compendium with separate folders for raw data, cleaned data, data wrangling scripts, analysis scripts, and outputs\n\nOR\n\nOrganize one of your R scripts with sections and apply a consistent coding style (e.g. with Code \\> Reformat Code or with the `styler` package)\n",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
],
"includes": {
"include-after-body": [
"\n<script>\n // htmlwidgets need to know to resize themselves when slides are shown/hidden.\n // Fire the \"slideenter\" event (handled by htmlwidgets.js) when the current\n // slide changes (different for each slide format).\n (function () {\n // dispatch for htmlwidgets\n function fireSlideEnter() {\n const event = window.document.createEvent(\"Event\");\n event.initEvent(\"slideenter\", true, true);\n window.document.dispatchEvent(event);\n }\n\n function fireSlideChanged(previousSlide, currentSlide) {\n fireSlideEnter();\n\n // dispatch for shiny\n if (window.jQuery) {\n if (previousSlide) {\n window.jQuery(previousSlide).trigger(\"hidden\");\n }\n if (currentSlide) {\n window.jQuery(currentSlide).trigger(\"shown\");\n }\n }\n }\n\n // hookup for slidy\n if (window.w3c_slidy) {\n window.w3c_slidy.add_observer(function (slide_num) {\n // slide_num starts at position 1\n fireSlideChanged(null, w3c_slidy.slides[slide_num - 1]);\n });\n }\n\n })();\n</script>\n\n"
]
},
"engineDependencies": {},
"preserve": {},
"postProcess": true
}
}
18 changes: 18 additions & 0 deletions _freeze/lessons/2-shell/slides/execute-results/html.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"hash": "3b17e98dd718da99b63be71dcc30e76c",
"result": {
"markdown": "---\ntitle: \"Shell Commands\"\nsubtitle: \"Session 2\"\n# date: TODO\nformat: revealjs\nexecute: \n echo: true\nengine: knitr\nchalkboard: true\nfooter: \"[Reproduciblity & Data Science in R](https://cct-datascience.github.io/repro-data-sci/)\"\n---\n\n\n# Review of last week\n\n- What happened as you were trying to re-organize projects or R code?\n - Victories?\n - Stumbling blocks?\n\n# Learning objectives\n\n- Understand the what and why of the shell\n- Interact with the shell using common commands\n- Find help via --help, man, and online help pages\n- Navigate your file system from the command line\n- (Time permitting) Manipulate and move files from the command line\n\n# What is the shell?\n\n- Command-line interface, in contrast to a GUI\n\n# Why learn the shell?\n\n- Be able to work with tools that don't have a GUI\n- Batch large tasks (e.g. renaming files)\n- Interact with remote computers like the University HPC\n\n# Let's get set up!\n\n- macOS comes with a shell (usually Bash or Zsh) built-in\n\n- Windows need to install GitBash (includes Bash shell and git, which we will use later)\n\n- Breakout rooms\n\n# Data download\n\n- Download `shell-lesson-data.zip`\n - Instructions here: <https://swcarpentry.github.io/shell-novice/index.html#download-files>\n- Save it to your Desktop and unzip it.\n\n# Coding time\n\n- Intro to shell commands\n\n# Syntax of a shell command\n\n![](shell_syntax.png){fig-align=\"center\"}\n\n# Coding time\n\n- File systems\n\n# Example file system\n\n![](file-path-example.png)\n\n# Example file system\n\n![](file-structure-example.png)\n\n# Homework for next time\n\n- Read [\"Excuse me, do you have a moment to talk about version control?\"](https://peerj.com/preprints/3159/)\n- Create a diagram of your file system and note your most frequently used directories\n",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
],
"includes": {
"include-after-body": [
"\n<script>\n // htmlwidgets need to know to resize themselves when slides are shown/hidden.\n // Fire the \"slideenter\" event (handled by htmlwidgets.js) when the current\n // slide changes (different for each slide format).\n (function () {\n // dispatch for htmlwidgets\n function fireSlideEnter() {\n const event = window.document.createEvent(\"Event\");\n event.initEvent(\"slideenter\", true, true);\n window.document.dispatchEvent(event);\n }\n\n function fireSlideChanged(previousSlide, currentSlide) {\n fireSlideEnter();\n\n // dispatch for shiny\n if (window.jQuery) {\n if (previousSlide) {\n window.jQuery(previousSlide).trigger(\"hidden\");\n }\n if (currentSlide) {\n window.jQuery(currentSlide).trigger(\"shown\");\n }\n }\n }\n\n // hookup for slidy\n if (window.w3c_slidy) {\n window.w3c_slidy.add_observer(function (slide_num) {\n // slide_num starts at position 1\n fireSlideChanged(null, w3c_slidy.slides[slide_num - 1]);\n });\n }\n\n })();\n</script>\n\n"
]
},
"engineDependencies": {},
"preserve": {},
"postProcess": true
}
}
18 changes: 18 additions & 0 deletions _freeze/lessons/3-git/slides/execute-results/html.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"hash": "123d04cb7a0dbb02fef341c21d9ef5b3",
"result": {
"markdown": "---\ntitle: \"Version Control With `git`\"\nsubtitle: \"Session 3\"\nformat: revealjs\nexecute: \n echo: true\nengine: knitr\nchalkboard: true\nfooter: \"[Reproduciblity & Data Science in R](https://cct-datascience.github.io/repro-data-sci/)\"\n---\n\n\n# Review 1\n\nWhat stood out to you when (if) you diagrammed your file system?\n\n# Review 2 {.smaller}\n\n![](/lessons/2-shell/file-structure-example.png)\n\nIf your current working directory is `Users/kristinariemer/Dropbox/Documents`, what command could be used to change directory into the local Documents folder?\n\n# Learning objectives\n\n- Understand the what and why of version control\n- Set up git on your computer\n- Create a git repository associated with an R project\n- Use git to track and record changes to a git repository\n- Use .gitignore to selectively exclude files from git.\n\n## \n\n::: columns\n::: {.column width=\"50%\"}\n[Version Control]{.r-fit-text}\n\nSemi-automated system for tracking changes with unlimited \"undo\"\n:::\n\n::: {.column width=\"50%\"}\n![](phd_final.jpg){fig-align=\"center\" width=\"449\"}\n:::\n:::\n\n## Why Learn Version Control?\n\n- Track development of research projects like a lab notebook\n\n- Keep project in sync across computers including HPC\n\n- Share and collaborate on projects in a sane way\n\n## Setting up `git` (once per machine)\n\nWe installed git last week, so you should be ready to set it up!\n\n``` {.bash filename=\"Shell\"}\ngit config --global user.name \"Your Name\"\ngit config --global user.email \"youremail@arizona.edu\" \n# Use your GitHub associated email\n```\n\n# Coding time\n\n`git config`\n\n# Coding time\n\nCreate an RStudio project and initialize it as a git repository.\n\nUse git status to check the state of the repo.\n\n# Coding time\n\nTrack modifications to a git repository.\n\n## Saving modifications: a two-step process\n\n![](git-simple.png)\n\n## Adding multiple files to same commit\n\n![](git-multiple.png)\n\n# Coding time\n\n`.gitignore`\n\n# Homework\n\n- Create a [GitHub](https://github.com) account if you don't have one.\n- Optional: Identify an exisitng folder on your computer and turn it into a git repository.\n",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
],
"includes": {
"include-after-body": [
"\n<script>\n // htmlwidgets need to know to resize themselves when slides are shown/hidden.\n // Fire the \"slideenter\" event (handled by htmlwidgets.js) when the current\n // slide changes (different for each slide format).\n (function () {\n // dispatch for htmlwidgets\n function fireSlideEnter() {\n const event = window.document.createEvent(\"Event\");\n event.initEvent(\"slideenter\", true, true);\n window.document.dispatchEvent(event);\n }\n\n function fireSlideChanged(previousSlide, currentSlide) {\n fireSlideEnter();\n\n // dispatch for shiny\n if (window.jQuery) {\n if (previousSlide) {\n window.jQuery(previousSlide).trigger(\"hidden\");\n }\n if (currentSlide) {\n window.jQuery(currentSlide).trigger(\"shown\");\n }\n }\n }\n\n // hookup for slidy\n if (window.w3c_slidy) {\n window.w3c_slidy.add_observer(function (slide_num) {\n // slide_num starts at position 1\n fireSlideChanged(null, w3c_slidy.slides[slide_num - 1]);\n });\n }\n\n })();\n</script>\n\n"
]
},
"engineDependencies": {},
"preserve": {},
"postProcess": true
}
}
18 changes: 18 additions & 0 deletions _freeze/lessons/4-github-basics/slides/execute-results/html.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"hash": "30c56442a65b0cd3f6aca80302e80754",
"result": {
"markdown": "---\ntitle: \"GitHub\"\nformat: revealjs\nexecute: \n echo: true\nengine: knitr\nchalkboard: true\nfooter: \"[Reproduciblity & Data Science in R](https://cct-datascience.github.io/repro-data-sci/)\"\nbibliography: references.bib\n---\n\n\n## Review & Homework\n\n- Turn folder into git repo with `git init`\n\n - Save changes to files with `git add` and `git commmit`\n\n- If you turned another project into a repo, how did it go?\n\n## Today's goals\n\n1. Learn how to tell git to ignore files\n2. Put a local repo on GitHub\n3. Use `git push` and `git pull` to synchronize with GitHub\n4. Use branches for new work\n\n## Ignoring files\n\n- If you created an RStudio project with git enabled, you should have a top-level `.gitignore`\n\n## Sharing with GitHub\n\n![](github-diagram-bryan.png){fig-align=\"center\" width=\"671\"}\n\n::: aside\nFigure 2 from [@bryan2018]\n:::\n\n::: notes\n- All contributors have a local copy of the repo.\n- You might also have a copy in multiple places (on multiple computers, on university HPC).\n- GitHub has a central repo that allows you to synchronize and merge work from multiple sources.\n- You can also access the repo through github.com web UI\n:::\n\n## Homework\n\nPut a project repo on GitHub and share the link on Slack\n\n## References\n\n::: refs\n:::\n",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
],
"includes": {
"include-after-body": [
"\n<script>\n // htmlwidgets need to know to resize themselves when slides are shown/hidden.\n // Fire the \"slideenter\" event (handled by htmlwidgets.js) when the current\n // slide changes (different for each slide format).\n (function () {\n // dispatch for htmlwidgets\n function fireSlideEnter() {\n const event = window.document.createEvent(\"Event\");\n event.initEvent(\"slideenter\", true, true);\n window.document.dispatchEvent(event);\n }\n\n function fireSlideChanged(previousSlide, currentSlide) {\n fireSlideEnter();\n\n // dispatch for shiny\n if (window.jQuery) {\n if (previousSlide) {\n window.jQuery(previousSlide).trigger(\"hidden\");\n }\n if (currentSlide) {\n window.jQuery(currentSlide).trigger(\"shown\");\n }\n }\n }\n\n // hookup for slidy\n if (window.w3c_slidy) {\n window.w3c_slidy.add_observer(function (slide_num) {\n // slide_num starts at position 1\n fireSlideChanged(null, w3c_slidy.slides[slide_num - 1]);\n });\n }\n\n })();\n</script>\n\n"
]
},
"engineDependencies": {},
"preserve": {},
"postProcess": true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"hash": "0417fb0c24005e96a9fb02242dcaeb94",
"result": {
"markdown": "---\ntitle: \"Data manipulation with `dplyr` and `tidyr`\"\nsubtitle: \"Session 6\"\nformat: revealjs\nexecute: \n echo: true\nengine: knitr\nchalkboard: true\nfooter: \"[Reproduciblity & Data Science in R](https://cct-datascience.github.io/repro-data-sci/)\"\n---\n\n\n# Review\n\n# Warm-up: create a branch for today's work\n\n# Learning objectives\n\n- Understand how R stores different data types\n- Know what the tidyverse is, how it differs from base R, and the philosophy behind using it here.\n- Use tidyverse packages (`dplyr` and `tidyr`) to work with data in R.\n- Practice tracking our work in git\n\n# Why learn data management in R?\n\n- Reproducible workflows\n- Reduce repetition\n\n# What is the tidyverse? Why use it?\n\n- (visual of the tidyverse)\n- Flexible and readable code\n- Consistent, widely-used formatting and syntax\n\n# Installing packages\n\n\n::: {.cell}\n\n```{.r .cell-code}\ninstall.packages(\"dplyr\")\ninstall.packages(\"tidyr\")\n```\n:::\n\n\n# Coding time\n\nHow R understands data\n\n# Coding time\n\nData manipulation with dplyr and tidyr\n\n# Coding time\n\nPractice git modify-add-commit cycle\n\n# Homework\n\nNone\n",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
],
"includes": {
"include-after-body": [
"\n<script>\n // htmlwidgets need to know to resize themselves when slides are shown/hidden.\n // Fire the \"slideenter\" event (handled by htmlwidgets.js) when the current\n // slide changes (different for each slide format).\n (function () {\n // dispatch for htmlwidgets\n function fireSlideEnter() {\n const event = window.document.createEvent(\"Event\");\n event.initEvent(\"slideenter\", true, true);\n window.document.dispatchEvent(event);\n }\n\n function fireSlideChanged(previousSlide, currentSlide) {\n fireSlideEnter();\n\n // dispatch for shiny\n if (window.jQuery) {\n if (previousSlide) {\n window.jQuery(previousSlide).trigger(\"hidden\");\n }\n if (currentSlide) {\n window.jQuery(currentSlide).trigger(\"shown\");\n }\n }\n }\n\n // hookup for slidy\n if (window.w3c_slidy) {\n window.w3c_slidy.add_observer(function (slide_num) {\n // slide_num starts at position 1\n fireSlideChanged(null, w3c_slidy.slides[slide_num - 1]);\n });\n }\n\n })();\n</script>\n\n"
]
},
"engineDependencies": {},
"preserve": {},
"postProcess": true
}
}
Loading

0 comments on commit feb0b70

Please sign in to comment.