Skip to content

brad-cannell/r_notes_quarto

Repository files navigation

Brad's R Notes - Quarto Version

This repository is for a Quarto version Brad Cannell's R Notes. This repository is primarily intended to be helpful to me, but even better if you find it useful too! This version of my R Notes replaces the previous Bookdown version.

Why am I doing this (as opposed to just keeping notes locally)?

  • Better organized (e.g., chapter structure and search).
  • Easy access -- just click on the bookmark on web browser.
  • Practice using Quarto.
  • Might help with R4Epi -- This can be sort of a sandbox for developing before I add things to R4Epi.

Useful websites:

Rendering

We can render the files by clicking the Render button in RStudio. To render the HTML and PDF files at the same time, type quarto render into the terminal.

```{bash}
quarto render
```

You can also render Quarto files with a native R code chunk.

  • The input argument: The input file or project directory to be rendered (defaults to rendering the project in the current working directory).

  • The output_format argument: Target output format (defaults to "html"). The option "all" will render all formats defined within the file or project.

```{r}
#| Render with R
#| eval: false
quarto::quarto_render(output_format = "all")
```

Publishing to GitHub pages

This article is great. After committing, and making sure you are on the main branch, type quarto publish gh-pages in the terminal.

```{bash}
quarto publish gh-pages
```

Publishing to Netlify

This article is great. After committing, and making sure you are on the main branch, type quarto publish netlify in the terminal.

```{bash}
quarto publish netlify
```

Where to publish

I've used Netlify in the past and have been happy with it. However, I'm not sure that it is necessary or efficient to add the extra layer of using Netlify in GitHub Pages will work just as well. Why introduce a third site into the mix if we don't have to? For now, I may just stick with GitHub Pages.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.