From 4b70761837f2aa2b4954b0ef7da2a6e5eebf7db2 Mon Sep 17 00:00:00 2001 From: Clifton McKee Date: Fri, 5 Jan 2024 16:22:39 -0500 Subject: [PATCH 01/10] Add lab --- docs/_schedule_table.Rmd | 2 +- modules/Reproducibility/Reproducibility.Rmd | 4 + .../lab/Reproducibility_Lab.Rmd | 34 ++ .../lab/Reproducibility_Lab.html | 430 ++++++++++++++++ .../lab/Reproducibility_Lab_Key.Rmd | 39 ++ .../lab/Reproducibility_Lab_Key.html | 471 ++++++++++++++++++ 6 files changed, 979 insertions(+), 1 deletion(-) create mode 100644 modules/Reproducibility/lab/Reproducibility_Lab.Rmd create mode 100644 modules/Reproducibility/lab/Reproducibility_Lab.html create mode 100644 modules/Reproducibility/lab/Reproducibility_Lab_Key.Rmd create mode 100644 modules/Reproducibility/lab/Reproducibility_Lab_Key.html diff --git a/docs/_schedule_table.Rmd b/docs/_schedule_table.Rmd index 00e62f067..ca12d4e47 100644 --- a/docs/_schedule_table.Rmd +++ b/docs/_schedule_table.Rmd @@ -4,7 +4,7 @@ | | | | | | | | [Day 1](docs/module_details/day1.html) | Intro | [HTML](modules/Intro/Intro.html), [PDF](modules/Intro/Intro.pdf) | [Rmd](modules/Intro/Intro.Rmd) | | [Day 1 Cheatsheet](modules/cheatsheets/Day-1.pdf) | | | RStudio | [HTML](modules/RStudio/RStudio.html), [PDF](modules/RStudio/RStudio.pdf) | [Rmd](modules/RStudio/RStudio.Rmd) | [Lab](modules/RStudio/lab/RStudio_Lab.Rmd), [Key](modules/RStudio/lab/RStudio_Lab_Key.Rmd), [Key HTML](modules/RStudio/lab/RStudio_Lab_Key.html) | | -| | Reproducibility | [HTML](modules/Reproducibility/Reproducibility.html), [PDF](modules/Reproducibility/Reproducibility.pdf) | [Rmd](modules/Reproducibility/Reproducibility.Rmd) | | [Good scientific coding practices](resources/good-scientific-coding-practices.pdf) | +| | Reproducibility | [HTML](modules/Reproducibility/Reproducibility.html), [PDF](modules/Reproducibility/Reproducibility.pdf) | [Rmd](modules/Reproducibility/Reproducibility.Rmd) | [Lab](modules/Reproducibility/lab/Reproducibility_Lab.Rmd), [Key](modules/Reproducibility/lab/Reproducibility_Lab_Key.Rmd), [Key HTML](modules/Reproducibility/lab/Reproducibility_Lab_Key.html) | [Good scientific coding practices](resources/good-scientific-coding-practices.pdf) | | | | | | | | | [Day 2](docs/module_details/day2.html) | Basic R | [HTML](modules/Basic_R/Basic_R.html), [PDF](modules/Basic_R/Basic_R.pdf) | [Rmd](modules/Basic_R/Basic_R.Rmd) | [Lab](modules/Basic_R/lab/Basic_R_Lab.Rmd), [Key](modules/Basic_R/lab/Basic_R_Lab_Key.Rmd), [Key HTML](modules/Basic_R/lab/Basic_R_Lab_Key.html) | [Day 2 Cheatsheet](modules/cheatsheets/Day-2.pdf) | | | Data Input | [HTML](modules/Data_Input/Data_Input.html), [PDF](modules/Data_Input/Data_Input.pdf) | [Rmd](modules/Data_Input/Data_Input.Rmd) | [Lab](modules/Data_Input/lab/Data_Input_Lab.Rmd), [Key](modules/Data_Input/lab/Data_Input_Lab_Key.Rmd), [Key HTML](modules/Data_Input/lab/Data_Input_Lab_Key.html) | [Debugging tips guide](resources/debugging_guide.pdf) | diff --git a/modules/Reproducibility/Reproducibility.Rmd b/modules/Reproducibility/Reproducibility.Rmd index 677ba2ee0..a47dcf9ea 100644 --- a/modules/Reproducibility/Reproducibility.Rmd +++ b/modules/Reproducibility/Reproducibility.Rmd @@ -174,6 +174,10 @@ sessionInfo() knitr::include_graphics("images/session_info.png") ``` +## Lab 1 + +🏠 [Class Website](https://jhudatascience.org/intro_to_r/) +💻 [Lab](https://jhudatascience.org/intro_to_r/modules/Reproducibility/lab/Reproducibility_Lab.Rmd) ## More resources diff --git a/modules/Reproducibility/lab/Reproducibility_Lab.Rmd b/modules/Reproducibility/lab/Reproducibility_Lab.Rmd new file mode 100644 index 000000000..3b758d36e --- /dev/null +++ b/modules/Reproducibility/lab/Reproducibility_Lab.Rmd @@ -0,0 +1,34 @@ +--- +title: "Reproducibility Lab" +output: html_document +editor_options: + chunk_output_type: console +--- + +1. Create two objects in your environment, `x` and `y`. Assign `x` as a vector of numbers 1, 2, and 3. Assign `y` as a vector of numbers 4, 5, and 6. Once complete, check that both objects are visible in your RStudio environment. +```{r} + +``` + +2. Clear your environment. Check that `x` and `y` are no longer in the environment by typing each letter in the console. What is the result? +```{r} + +``` + +3. Check your R session info. Which version of R are you running? Which version of the `knitr` package are you running? Write these details below. +```{r} + +``` + +- R version: +- knitr version: + +**Bonus / Extra practice**: Create a vector `z` with the numbers 0 to 9. Set the seed for the R random number generator to 1234. Draw 5 numbers at random from `z` using the `sample()` function with `replace = TRUE`. Repeatedly run the code 3 times and note what you observe. +```{r} + +``` + +**Bonus / Extra practice**: Run the `sample()` statement again, but this time without running the `set.seed()` line. What do you notice about the 5 numbers? +```{r} + +``` diff --git a/modules/Reproducibility/lab/Reproducibility_Lab.html b/modules/Reproducibility/lab/Reproducibility_Lab.html new file mode 100644 index 000000000..14b13e319 --- /dev/null +++ b/modules/Reproducibility/lab/Reproducibility_Lab.html @@ -0,0 +1,430 @@ + + + + + + + + + + + + + +Reproducibility Lab + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
    +
  1. Create two objects in your environment, x and +y. Assign x as a vector of numbers 1, 2, and +3. Assign y as a vector of numbers 4, 5, and 6. Once +complete, check that both objects are visible in your RStudio +environment.

  2. +
  3. Clear your environment. Check that x and +y are no longer in the environment by typing each letter in +the console. What is the result?

  4. +
  5. Check your R session info. Which version of R are you running? +Which version of the knitr package are you running? Write +these details below.

  6. +
+ +

Bonus / Extra practice: Create a vector +z with the numbers 0 to 9. Set the seed for the R random +number generator to 1234. Draw 5 numbers at random from z +using the sample() function with +replace = TRUE. Repeatedly run the code 3 times and note +what you observe.

+

Bonus / Extra practice: Run the +sample() statement again, but this time without running the +set.seed() line. What do you notice about the 5 +numbers?

+ + + + +
+ + + + + + + + + + + + + + + diff --git a/modules/Reproducibility/lab/Reproducibility_Lab_Key.Rmd b/modules/Reproducibility/lab/Reproducibility_Lab_Key.Rmd new file mode 100644 index 000000000..5a9753db4 --- /dev/null +++ b/modules/Reproducibility/lab/Reproducibility_Lab_Key.Rmd @@ -0,0 +1,39 @@ +--- +title: "Reproducibility Lab Key" +output: html_document +editor_options: + chunk_output_type: console +--- + +1. Create two objects in your environment, `x` and `y`. Assign `x` as a vector of numbers 1, 2, and 3. Assign `y` as a vector of numbers 4, 5, and 6. Once complete, check that both objects are visible in your RStudio environment. +```{r} +x <- c(1, 2, 3) +y <- c(4, 5, 6) +x +y +``` + +2. Clear your environment. Check that `x` and `y` are no longer in the environment by typing each letter in the console. What is the result? +```{r} +rm(list = ls()) +``` + +3. Check your R session info. Which version of R are you running? Which version of the `knitr` package are you running? Write these details below. +```{r} +sessionInfo() +``` + +- R version: +- knitr version: + +**Bonus / Extra practice**: Create a vector `z` with the numbers 0 to 9. Set the seed for the R random number generator to 1234. Draw 5 numbers at random from `z` using the `sample()` function with `replace = TRUE`. Repeatedly run the code 3 times and note what you observe. +```{r} +z <- 0:9 +set.seed(1234) +sample(x = z, size = 5, replace = TRUE) +``` + +**Bonus / Extra practice**: Run the `sample()` statement again, but this time without running the `set.seed()` line. What do you notice about the 5 numbers? +```{r} +sample(x = z, size = 5, replace = TRUE) +``` diff --git a/modules/Reproducibility/lab/Reproducibility_Lab_Key.html b/modules/Reproducibility/lab/Reproducibility_Lab_Key.html new file mode 100644 index 000000000..cea4e1dea --- /dev/null +++ b/modules/Reproducibility/lab/Reproducibility_Lab_Key.html @@ -0,0 +1,471 @@ + + + + + + + + + + + + + +Reproducibility Lab Key + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
    +
  1. Create two objects in your environment, x and +y. Assign x as a vector of numbers 1, 2, and +3. Assign y as a vector of numbers 4, 5, and 6. Once +complete, check that both objects are visible in your RStudio +environment.
  2. +
+
x <- c(1, 2, 3)
+y <- c(4, 5, 6)
+x
+
## [1] 1 2 3
+
y
+
## [1] 4 5 6
+
    +
  1. Clear your environment. Check that x and y +are no longer in the environment by typing each letter in the console. +What is the result?
  2. +
+
rm(list = ls())
+
    +
  1. Check your R session info. Which version of R are you running? Which +version of the knitr package are you running? Write these +details below.
  2. +
+
sessionInfo()
+
## R version 4.3.2 (2023-10-31)
+## Platform: aarch64-apple-darwin20 (64-bit)
+## Running under: macOS Monterey 12.4
+## 
+## Matrix products: default
+## BLAS:   /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib 
+## LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0
+## 
+## locale:
+## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
+## 
+## time zone: America/New_York
+## tzcode source: internal
+## 
+## attached base packages:
+## [1] stats     graphics  grDevices utils     datasets  methods   base     
+## 
+## loaded via a namespace (and not attached):
+##  [1] digest_0.6.33     R6_2.5.1          fastmap_1.1.1     xfun_0.41        
+##  [5] cachem_1.0.8      knitr_1.45        htmltools_0.5.7   rmarkdown_2.25   
+##  [9] lifecycle_1.0.4   cli_3.6.2         sass_0.4.8        jquerylib_0.1.4  
+## [13] compiler_4.3.2    rstudioapi_0.15.0 tools_4.3.2       evaluate_0.23    
+## [17] bslib_0.6.1       yaml_2.3.8        rlang_1.1.2       jsonlite_1.8.8
+ +

Bonus / Extra practice: Create a vector +z with the numbers 0 to 9. Set the seed for the R random +number generator to 1234. Draw 5 numbers at random from z +using the sample() function with +replace = TRUE. Repeatedly run the code 3 times and note +what you observe.

+
z <- 0:9
+set.seed(1234)
+sample(x = z, size = 5, replace = TRUE)
+
## [1] 9 5 4 8 4
+

Bonus / Extra practice: Run the +sample() statement again, but this time without running the +set.seed() line. What do you notice about the 5 +numbers?

+
sample(x = z, size = 5, replace = TRUE)
+
## [1] 5 3 1 6 5
+ + + + +
+ + + + + + + + + + + + + + + From 02a6d56f32b7457694b6d226e7ad0ddc99f9901d Mon Sep 17 00:00:00 2001 From: Clifton McKee Date: Fri, 5 Jan 2024 16:33:20 -0500 Subject: [PATCH 02/10] Remove HTMLs --- .../lab/Reproducibility_Lab.html | 430 ---------------- .../lab/Reproducibility_Lab_Key.html | 471 ------------------ 2 files changed, 901 deletions(-) delete mode 100644 modules/Reproducibility/lab/Reproducibility_Lab.html delete mode 100644 modules/Reproducibility/lab/Reproducibility_Lab_Key.html diff --git a/modules/Reproducibility/lab/Reproducibility_Lab.html b/modules/Reproducibility/lab/Reproducibility_Lab.html deleted file mode 100644 index 14b13e319..000000000 --- a/modules/Reproducibility/lab/Reproducibility_Lab.html +++ /dev/null @@ -1,430 +0,0 @@ - - - - - - - - - - - - - -Reproducibility Lab - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - -
    -
  1. Create two objects in your environment, x and -y. Assign x as a vector of numbers 1, 2, and -3. Assign y as a vector of numbers 4, 5, and 6. Once -complete, check that both objects are visible in your RStudio -environment.

  2. -
  3. Clear your environment. Check that x and -y are no longer in the environment by typing each letter in -the console. What is the result?

  4. -
  5. Check your R session info. Which version of R are you running? -Which version of the knitr package are you running? Write -these details below.

  6. -
-
    -
  • R version:
  • -
  • knitr version:
  • -
-

Bonus / Extra practice: Create a vector -z with the numbers 0 to 9. Set the seed for the R random -number generator to 1234. Draw 5 numbers at random from z -using the sample() function with -replace = TRUE. Repeatedly run the code 3 times and note -what you observe.

-

Bonus / Extra practice: Run the -sample() statement again, but this time without running the -set.seed() line. What do you notice about the 5 -numbers?

- - - - -
- - - - - - - - - - - - - - - diff --git a/modules/Reproducibility/lab/Reproducibility_Lab_Key.html b/modules/Reproducibility/lab/Reproducibility_Lab_Key.html deleted file mode 100644 index cea4e1dea..000000000 --- a/modules/Reproducibility/lab/Reproducibility_Lab_Key.html +++ /dev/null @@ -1,471 +0,0 @@ - - - - - - - - - - - - - -Reproducibility Lab Key - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - -
    -
  1. Create two objects in your environment, x and -y. Assign x as a vector of numbers 1, 2, and -3. Assign y as a vector of numbers 4, 5, and 6. Once -complete, check that both objects are visible in your RStudio -environment.
  2. -
-
x <- c(1, 2, 3)
-y <- c(4, 5, 6)
-x
-
## [1] 1 2 3
-
y
-
## [1] 4 5 6
-
    -
  1. Clear your environment. Check that x and y -are no longer in the environment by typing each letter in the console. -What is the result?
  2. -
-
rm(list = ls())
-
    -
  1. Check your R session info. Which version of R are you running? Which -version of the knitr package are you running? Write these -details below.
  2. -
-
sessionInfo()
-
## R version 4.3.2 (2023-10-31)
-## Platform: aarch64-apple-darwin20 (64-bit)
-## Running under: macOS Monterey 12.4
-## 
-## Matrix products: default
-## BLAS:   /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib 
-## LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0
-## 
-## locale:
-## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-## 
-## time zone: America/New_York
-## tzcode source: internal
-## 
-## attached base packages:
-## [1] stats     graphics  grDevices utils     datasets  methods   base     
-## 
-## loaded via a namespace (and not attached):
-##  [1] digest_0.6.33     R6_2.5.1          fastmap_1.1.1     xfun_0.41        
-##  [5] cachem_1.0.8      knitr_1.45        htmltools_0.5.7   rmarkdown_2.25   
-##  [9] lifecycle_1.0.4   cli_3.6.2         sass_0.4.8        jquerylib_0.1.4  
-## [13] compiler_4.3.2    rstudioapi_0.15.0 tools_4.3.2       evaluate_0.23    
-## [17] bslib_0.6.1       yaml_2.3.8        rlang_1.1.2       jsonlite_1.8.8
-
    -
  • R version:
  • -
  • knitr version:
  • -
-

Bonus / Extra practice: Create a vector -z with the numbers 0 to 9. Set the seed for the R random -number generator to 1234. Draw 5 numbers at random from z -using the sample() function with -replace = TRUE. Repeatedly run the code 3 times and note -what you observe.

-
z <- 0:9
-set.seed(1234)
-sample(x = z, size = 5, replace = TRUE)
-
## [1] 9 5 4 8 4
-

Bonus / Extra practice: Run the -sample() statement again, but this time without running the -set.seed() line. What do you notice about the 5 -numbers?

-
sample(x = z, size = 5, replace = TRUE)
-
## [1] 5 3 1 6 5
- - - - -
- - - - - - - - - - - - - - - From 1f2c907b106e66961925fbffe481f0b96f97a955 Mon Sep 17 00:00:00 2001 From: Clifton McKee Date: Fri, 5 Jan 2024 16:40:55 -0500 Subject: [PATCH 03/10] Spellcheck and dict updated --- modules/Reproducibility/lab/Reproducibility_Lab.Rmd | 2 +- modules/Reproducibility/lab/Reproducibility_Lab_Key.Rmd | 2 +- resources/dictionary.txt | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/Reproducibility/lab/Reproducibility_Lab.Rmd b/modules/Reproducibility/lab/Reproducibility_Lab.Rmd index 3b758d36e..6e1ad43c2 100644 --- a/modules/Reproducibility/lab/Reproducibility_Lab.Rmd +++ b/modules/Reproducibility/lab/Reproducibility_Lab.Rmd @@ -21,7 +21,7 @@ editor_options: ``` - R version: -- knitr version: +- `knitr` version: **Bonus / Extra practice**: Create a vector `z` with the numbers 0 to 9. Set the seed for the R random number generator to 1234. Draw 5 numbers at random from `z` using the `sample()` function with `replace = TRUE`. Repeatedly run the code 3 times and note what you observe. ```{r} diff --git a/modules/Reproducibility/lab/Reproducibility_Lab_Key.Rmd b/modules/Reproducibility/lab/Reproducibility_Lab_Key.Rmd index 5a9753db4..418be010b 100644 --- a/modules/Reproducibility/lab/Reproducibility_Lab_Key.Rmd +++ b/modules/Reproducibility/lab/Reproducibility_Lab_Key.Rmd @@ -24,7 +24,7 @@ sessionInfo() ``` - R version: -- knitr version: +- `knitr` version: **Bonus / Extra practice**: Create a vector `z` with the numbers 0 to 9. Set the seed for the R random number generator to 1234. Draw 5 numbers at random from `z` using the `sample()` function with `replace = TRUE`. Repeatedly run the code 3 times and note what you observe. ```{r} diff --git a/resources/dictionary.txt b/resources/dictionary.txt index e508c20da..c4860c14e 100644 --- a/resources/dictionary.txt +++ b/resources/dictionary.txt @@ -98,6 +98,7 @@ jhur jitter Juneteenth Kaggle +knitr Lawlor lefthand Leanpub From 8d6b1dae9d267f03871c6d7358f5941697d16b93 Mon Sep 17 00:00:00 2001 From: avahoffman Date: Fri, 5 Jan 2024 16:53:42 -0500 Subject: [PATCH 04/10] Completely trivial change --- modules/Intro/Intro.Rmd | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/Intro/Intro.Rmd b/modules/Intro/Intro.Rmd index 38594b2fb..4d74a83ac 100644 --- a/modules/Intro/Intro.Rmd +++ b/modules/Intro/Intro.Rmd @@ -535,3 +535,7 @@ knitr::include_graphics(here::here("images/the-end-g23b994289_1280.jpg")) Image by Gerd Altmann from Pixabay + + + + From 16871051812473dc48a9831036913ea20a8bb5a2 Mon Sep 17 00:00:00 2001 From: Clifton McKee Date: Fri, 5 Jan 2024 17:11:13 -0500 Subject: [PATCH 05/10] Fix ottr installation --- modules/Reproducibility/Reproducibility.Rmd | 8 +- modules/Reproducibility/Reproducibility.html | 336 ------------------- 2 files changed, 5 insertions(+), 339 deletions(-) delete mode 100644 modules/Reproducibility/Reproducibility.html diff --git a/modules/Reproducibility/Reproducibility.Rmd b/modules/Reproducibility/Reproducibility.Rmd index a47dcf9ea..174a24f7a 100644 --- a/modules/Reproducibility/Reproducibility.Rmd +++ b/modules/Reproducibility/Reproducibility.Rmd @@ -6,9 +6,11 @@ output: widescreen: yes --- +```{r include=FALSE} +knitr::opts_chunk$set(echo = FALSE, message = FALSE, comment=FALSE, warning=FALSE) +``` - -```{r, echo = FALSE, message = FALSE, comment=FALSE} +```{r} # from these slides: https://docs.google.com/presentation/d/1-cauITbscmnDEDt5IqrZOLlCjyhzEOZY5fqwVY7l8tQ/edit?usp=sharing library(knitr) opts_chunk$set(comment = "") @@ -17,7 +19,7 @@ suppressPackageStartupMessages(library(dplyr)) library(tidyverse) library(devtools) library(remotes) -install.packages("ottrpal") +install.packages("ottrpal", repos = "https://cloud.r-project.org") library(ottrpal) ``` diff --git a/modules/Reproducibility/Reproducibility.html b/modules/Reproducibility/Reproducibility.html deleted file mode 100644 index b91ebfb0f..000000000 --- a/modules/Reproducibility/Reproducibility.html +++ /dev/null @@ -1,336 +0,0 @@ - - - - Reproducibility - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- -

-
-
- -

What’s Reproducibility

- -

session info

- -

- -

session info

- -

- -

session info

- -

- -

session info

- -

Reproducibility vs Repeatability vs Replicability

- -

session info

- -

Why Reproducibility is important…

- -

session info

- -

It’s worth the wait

- -

session info

- -

Reproducibility can also be for your future self!

- -

session info

- -

The process

- -

session info

- -

R Markdown

- -

session info

- -

R Markdown lets you test your work

- -

session info

- -

R Markdown allows you to more clearly show what you did

- -

session info

- -

R Markdown makes it easier to update code and see results

- -

session info

- -

Clean your environment

- -

Regularly cleaning your environment and trying your code again, can help ensure that your code is running as expected.

- -

Occasionally we might forget to save a step of our code in our R Markdown file that we ran only in the console. This will help us figure that out.

- -

session info

- -

Check if your file knits regularly

- -

Regularly checking if your file knits will help you spot a missing step or error earlier when you have less code to try to identify where your code might have gone wrong.

- -

session info

- -

Tell your future self and others what you did!

- -

Provide sufficient detail so that you can understand what you did.

- -

R Markdown syntax

- -

Before: Markdown sytax before rendering

- -

After knit: Result of markdown sytax after rendering

- -

R Markdown syntax

- -

Go to Help > Cheat Sheets > R Markdown Cheat Sheet (which will download it)

- -

Or checkout Help > Cheat Sheets > R Markdown Reference Guide

- -

Or checkout the 🏠 Class Website!

- -

The End

- -

Versions matter

- -

session info

- -

Session info can help

- -
sessionInfo()
- -

session info

- -

More resources

Summary

- -

To help make your work more reproducible:

- -
    -
  • Use RMarkdown
  • -
  • Clean your environment regularly
  • -
  • Check the knit of your RMarkdown regularly
  • -
  • Tell your future self and others what you did!
  • -
  • Print session info!
  • -
- -

🏠 Class Website

- -

The End

- -

Image by Gerd Altmann from Pixabay

- - - - -
- - - - - - - - - From 47d78d371355c4414851ec313b0c038e3f297711 Mon Sep 17 00:00:00 2001 From: avahoffman Date: Fri, 5 Jan 2024 17:37:58 -0500 Subject: [PATCH 06/10] Add some debugging --- scripts/render_modules.R | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/render_modules.R b/scripts/render_modules.R index 912941e7b..d4eadf416 100644 --- a/scripts/render_modules.R +++ b/scripts/render_modules.R @@ -56,10 +56,15 @@ if (length(lab_files) != 0) { # loop thru and render all lecture files to html # Specific module name will be pulled out based on the dir name in modules/ + +message("debug 1") if (length(lecture_files) != 0) { + message("debug 2") for (i in 1:length(lecture_files)) { + message("debug 3") module_name <- stringr::str_split(lecture_files, pattern = '/')[[i]][2] + message("debug 4") rmarkdown::render(lecture_files[i], output_dir = paste0("modules/", module_name)) } From 900c080d7c57808b7418e1debe6eebc1844f20b9 Mon Sep 17 00:00:00 2001 From: avahoffman Date: Fri, 5 Jan 2024 17:48:05 -0500 Subject: [PATCH 07/10] Bug fix for environment changing when labs are rendered --- scripts/render_modules.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/render_modules.R b/scripts/render_modules.R index d4eadf416..b8892a2a1 100644 --- a/scripts/render_modules.R +++ b/scripts/render_modules.R @@ -50,7 +50,8 @@ if (length(lab_files) != 0) { for (i in 1:length(lab_files)) { module_name <- stringr::str_split(lab_files, pattern = '/')[[i]][2] rmarkdown::render(lab_files[i], - output_dir = paste0("modules/", module_name, "/lab")) + output_dir = paste0("modules/", module_name, "/lab"), + envir = new.env()) } } @@ -66,6 +67,7 @@ if (length(lecture_files) != 0) { stringr::str_split(lecture_files, pattern = '/')[[i]][2] message("debug 4") rmarkdown::render(lecture_files[i], - output_dir = paste0("modules/", module_name)) + output_dir = paste0("modules/", module_name), + envir = new.env()) } } From b5efed842da9c73e233644d99033ca8d7a6929b8 Mon Sep 17 00:00:00 2001 From: avahoffman Date: Fri, 5 Jan 2024 17:53:10 -0500 Subject: [PATCH 08/10] Add `quiet = TRUE` --- modules/Reproducibility/Reproducibility.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Reproducibility/Reproducibility.Rmd b/modules/Reproducibility/Reproducibility.Rmd index 174a24f7a..ebf2127f8 100644 --- a/modules/Reproducibility/Reproducibility.Rmd +++ b/modules/Reproducibility/Reproducibility.Rmd @@ -19,7 +19,7 @@ suppressPackageStartupMessages(library(dplyr)) library(tidyverse) library(devtools) library(remotes) -install.packages("ottrpal", repos = "https://cloud.r-project.org") +install.packages("ottrpal", repos = "https://cloud.r-project.org", quiet = TRUE) library(ottrpal) ``` From e5d4a8eb95e300f90a3a44a990ece97fc3dac0a3 Mon Sep 17 00:00:00 2001 From: avahoffman Date: Fri, 5 Jan 2024 18:01:48 -0500 Subject: [PATCH 09/10] Remove debug msgs --- scripts/render_modules.R | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/render_modules.R b/scripts/render_modules.R index b8892a2a1..e98eed17c 100644 --- a/scripts/render_modules.R +++ b/scripts/render_modules.R @@ -58,14 +58,10 @@ if (length(lab_files) != 0) { # loop thru and render all lecture files to html # Specific module name will be pulled out based on the dir name in modules/ -message("debug 1") if (length(lecture_files) != 0) { - message("debug 2") for (i in 1:length(lecture_files)) { - message("debug 3") module_name <- stringr::str_split(lecture_files, pattern = '/')[[i]][2] - message("debug 4") rmarkdown::render(lecture_files[i], output_dir = paste0("modules/", module_name), envir = new.env()) From 4e9c3ccb04e7c4cb36dbcd1ea1f100026d8cea26 Mon Sep 17 00:00:00 2001 From: Clifton McKee Date: Fri, 5 Jan 2024 20:52:52 -0500 Subject: [PATCH 10/10] =?UTF-8?q?Rebase=20divergent=20branch=20situation?= =?UTF-8?q?=20=F0=9F=A4=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index abc126650..7a3f7e904 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -474,7 +474,7 @@ jobs: echo "changes=$changes" >> $GITHUB_OUTPUT git add . --force git commit -m 'Render preview' || echo "No changes to commit" - git pull --set-upstream origin $branch_name --allow-unrelated-histories --strategy-option=ours + git pull --rebase --set-upstream origin $branch_name --allow-unrelated-histories --strategy-option=ours git push --force || echo "No changes to commit" shell: bash