Skip to content

Commit 08ffd50

Browse files
committed
update code chunks
1 parent 79f98cc commit 08ffd50

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

quarto-eth-phd-thesis.qmd

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ quarto-eth-phd-thesis/
135135

136136
I use the `.Rprofile` to load R packages rather than specifying packages within individual `.qmd` files or `.R` scripts as the .Rprofile is called prior to rendering each file. Add any additional packages you require here.
137137

138-
```{r, eval=FALSE}
138+
```
139139
#load packages
140140
packs<-c("ggplot2", "knitr", "kableExtra", "ggthemes", "stringr")
141141
@@ -149,7 +149,7 @@ Also in the `.Rprofile` are some functions to streamline uniform styling of figu
149149

150150
For tables the `thesis_tbl()` function sets options for `knitr::kbl()` and `kableExtra::kable_styling()` to produce booktabs style tables, with center aligned content and bold column titles:
151151

152-
```{r, eval=FALSE}
152+
```
153153
thesis_tbl <- function(x, escape, ltable = FALSE) {
154154
x %>%
155155
kbl(digits = 3,
@@ -171,7 +171,7 @@ thesis_tbl <- function(x, escape, ltable = FALSE) {
171171

172172
An example of applying this function is included in `chapters/paper-01-qmd`:
173173

174-
```{r, eval=FALSE}
174+
```
175175
#| tbl-pos: H
176176
177177
#load csv of allocation parameter summary statistics
@@ -188,7 +188,7 @@ Calibration_summary %>%
188188

189189
For figures the function `theme_publication()` sets a custom `ggplot2` theme:
190190

191-
```{r, eval=FALSE}
191+
```
192192
#' theme_publication
193193
#'
194194
#' custom ggplot2 theme to apply to all plots
@@ -235,7 +235,7 @@ theme_thesis <- function(
235235

236236
In addition the `.Rprofile` contains a series of functions for producing custom continuous and discrete color palettes with the base set of colors specified within the function `thesis_color()`:
237237

238-
```{r, eval=FALSE}
238+
```
239239
thesis_color <- function(...) {
240240
241241
thesis_colors <- c(
@@ -270,7 +270,7 @@ thesis_color <- function(...) {
270270

271271
These color palettes can be applied using defined `ggplot2::scale_color_*` and `ggplot2::scale_fill_*` methods. An example of applying the `theme_thesis()` and `scale_color_thesis()` functions is provided in `chapters/paper-01/paper-01-figs.R:`
272272

273-
```{r, eval=FALSE}
273+
```
274274
p <- ggplot(mtcars, aes(x = wt, y = mpg, color = factor(cyl))) +
275275
geom_point(size = 3) +
276276
labs(
@@ -393,7 +393,7 @@ The code for this is included in `chapters/paper-01/paper-01.qmd` and it uses th
393393

394394
My preferred method of preparing figures for Quarto documents is to produce and save them via dedicated R scripts rather than directly within the `.qmd` files themselves. This R script is then sourced directly at the head of the respective `.qmd` file to ensure the most up to date figures are used and the images are then included for each figure as in `paper-01.qmd`:
395395

396-
```{bash}
396+
```
397397
#source the script that prepares all the figures
398398
source("chapters/paper-01/paper-01-figs.R")
399399

0 commit comments

Comments
 (0)