Skip to content

Commit 9001ead

Browse files
committed
Auto-tangled all files.
1 parent ffd5b80 commit 9001ead

File tree

36 files changed

+4552
-0
lines changed

36 files changed

+4552
-0
lines changed

_post_template.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#| label: flametree
2+
#| echo: false
3+
#| fig-cap-location: "top"
4+

index.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

lectures.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

posts/01-welcome/index.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#| eval: false
2+
## install.packages("tidyverse")
3+
4+
5+
6+
options(width = 120)
7+
sessioninfo::session_info()
8+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#| label: packageinstall
2+
#| eval: false
3+
#| echo: true
4+
## install.packages("ggplot2")
5+
##
6+
## ## Below is an example for installing more than one package at a time:
7+
##
8+
## ## Install R packages for project 0
9+
## install.packages(
10+
## c("postcards", "usethis", "gitcreds")
11+
## )
12+
13+
14+
#| eval: false
15+
#| echo: true
16+
## tools::package_dependencies("ggplot2")
17+
18+
19+
#| eval: false
20+
#| echo: true
21+
## remotes::install_github()
22+
23+
24+
#| eval: false
25+
#| echo: true
26+
## library("ggplot2")
27+
28+
29+
30+
options(width = 120)
31+
sessioninfo::session_info()
32+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#| label: versioncontrol
2+
#| echo: false
3+
#| fig-cap: 'How not to use GitHub [image from PhD Comics]'
4+
#| out-width: '80%'
5+
knitr::include_graphics("../../images/phdversioncontrol.gif")
6+
7+
8+
#| label: happygitwithr
9+
#| echo: false
10+
#| fig-cap: 'A screenshot of the Happy Git with R online book from Jenny Bryan'
11+
#| out-width: '80%'
12+
knitr::include_graphics("../../images/happygitwithr.png")
13+
14+
15+
#| eval: false
16+
## install.packages("reprex")
17+
18+
19+
20+
options(width = 120)
21+
sessioninfo::session_info()
22+
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#| label: setup
2+
#| include: false
3+
library(here)
4+
5+
6+
#| eval: false
7+
## install.packages(c("here", "sessioninfo"))
8+
9+
10+
11+
## This is my relative directory
12+
here::here()
13+
14+
## I can now easily share code to access files from this project
15+
## such as access to the flight.csv file saved under the data
16+
## directory.
17+
here::here("data", "flights.csv")
18+
19+
## This would not be easily shareable as you don't have
20+
## "/Users/leocollado/Dropbox/Code" on your computer
21+
full_path <- "/Users/leocollado/Dropbox/Code/jhustatcomputing2023/data/flights.csv"
22+
23+
24+
#| eval: false
25+
## ## Reproducibility information
26+
## print("Reproducibility information:")
27+
## Sys.time()
28+
## proc.time()
29+
## options(width = 120)
30+
## sessioninfo::session_info()
31+
32+
33+
34+
## Reproducibility information
35+
print("Reproducibility information:")
36+
Sys.time()
37+
proc.time()
38+
options(width = 120)
39+
sessioninfo::session_info()
40+
41+
42+
43+
library("colorout") ## Load a package I installed from GitHub
44+
sessioninfo::session_info()
45+
46+
47+
48+
options(width = 120)
49+
sessioninfo::session_info()
50+

posts/05-literate-programming/index.R

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
2+
data(airquality)
3+
plot(airquality$Ozone ~ airquality$Wind)
4+
5+
6+
7+
knitr::include_graphics("https://d33wubrfki0l68.cloudfront.net/61d189fd9cdf955058415d3e1b28dd60e1bd7c9b/9791d/images/rmarkdownflow.png")
8+
9+
10+
#| label: missionaccomplished
11+
#| echo: false
12+
#| out-width: '60%'
13+
#| fig-cap: "Mission accomplished!"
14+
knitr::include_graphics("https://media.giphy.com/media/L4ZZNbDpOCfiX8uYSd/giphy.gif")
15+
16+
17+
#| label: hex-blogdown
18+
#| echo: false
19+
#| out-width: '30%'
20+
#| fig-cap: "blogdown logo"
21+
knitr::include_graphics("https://bookdown.org/yihui/blogdown/images/logo.png")
22+
23+
24+
#| label: hex-bookdown
25+
#| echo: false
26+
#| out-width: '30%'
27+
#| fig-cap: "book logo"
28+
knitr::include_graphics("https://bookdown.org/yihui/bookdown/images/logo.png")
29+
30+
31+
32+
## library(package)
33+
34+
35+
36+
## matrix(data, nrow = rows, ncol = cols)
37+
38+
39+
40+
## if (condition) {
41+
## ## Case 1
42+
## } else if (condition) {
43+
## ## Case 2
44+
## } else if (condition) {
45+
## ## Case 3
46+
## }
47+
48+
49+
50+
## name <- function(variables) {
51+
##
52+
## }
53+
54+
55+
56+
## for (variable in vector) {
57+
##
58+
## }
59+
60+
61+
62+
## # Tue Jan 21 20:20:14 2020 ------------------------------
63+
64+
65+
#| eval: false
66+
## ## Install styler for automatically styling scripts
67+
## install.packages("styler")
68+
##
69+
## ## Install biocthis
70+
## if (!require("BiocManager", quietly = TRUE))
71+
## install.packages("BiocManager")
72+
##
73+
## BiocManager::install("biocthis")
74+
75+
76+
77+
## Example code for styling all files that end with .qmd
78+
cat(readLines(here::here("scripts", "auto_style.R")))
79+
80+
81+
#| eval: false
82+
## ## For the styler addin
83+
## # Affects the output of: styler:::get_addins_style_transformer_name()
84+
## # https://github.com/r-lib/styler/blob/acfb42acc2e558e7b57ef133f1470df78b5093fd/R/addins.R#L183
85+
## options("styler.addins_style_transformer" = "biocthis::bioc_style()")
86+
87+
88+
89+
options(width = 120)
90+
sessioninfo::session_info()
91+

posts/06-reference-management/index.R

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
citation("rmarkdown")
3+
4+
5+
6+
knitr::write_bib("rmarkdown", file = "my-refs.bib")
7+
8+
9+
10+
list.files()
11+
12+
13+
#| eval: false
14+
## install.packages(c("bibtex", "RefManageR"))
15+
16+
17+
18+
options(width = 120)
19+
sessioninfo::session_info()
20+

0 commit comments

Comments
 (0)