1 + 1
[1] 2
This is a Quarto book.
To learn more about Quarto books visit https://quarto.org/docs/books
This is a static code chunk, which runs the R code in the code chunk below, and lists the output after the code chunk.
1 + 1
[1] 2
A Quarto live extension has been installed in this project. In this case, we are using coatless/webr
, as it works for books, while rwasm/live
does not yet work for books.
The documentation for Quarto Live can be read here.
Note that to make live webr code chunks work with packages beyond base R, each chapter qmd document needs to have a yaml header that looks something like:
---
: live-html
format:
webr: knitr
engine:
packages- tidyverse
- gt
- medicaldata
---
In order to install the particular packages needed for that chapter for the use of the live code chunks.
Note that this is separate from the setup
code chunk, which loads packages for the static code chunks and for inline R code.
This will allow you to create live code chunks that you can edit and run, like the one below. Note that when you load a webpage with a live code chunk that loads packages, a black dot will flash at the top right of each code chunk (just to the left of the Run Code
button) until all of the packages are loaded. Only then will you be able to run the live webr code chunks.
Also note that each live webr code chunk will start with {webr-r}
rather than {r}
for static code chunks.
The below is a live, or dynamic code chunk.
Check out the live webr code chunk in the next chapter (which does use packages beyond base R).
Many of the following chapters were inspired by blogposts, websites, and e-books that go into far greater depth on topics like modeling, mapping health data, data wrangling, etc. The end of many chapters includes a section on where to explore further. For many of these areas, this book is only an introduction.
The HealthyR book has been an inspiration, and the work of Ewen Harrison and Riinu Pius has been inspirational.