-
Notifications
You must be signed in to change notification settings - Fork 3
/
get-started_2.qmd
47 lines (31 loc) · 3.52 KB
/
get-started_2.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
title: "Tutorial: Computations"
---
### Some comments before the tutorial
- The tutorial uses the [Visual Editor](https://quarto.org/docs/visual-editor/) in RStudio. We recommend to frequently switch between *Visual* and *Source* mode during the tutorial to see how the raw markdown syntax looks like.
- Remember to put all *.qmd* files you download during the tutorial into the RStudio project directory you have created [earlier](preparations.qmd).
- We recommend to skip the [caching](https://quarto.org/docs/get-started/computations/rstudio.html#caching) section of the tutorial for now.
### Start the tutorial
If you have problems during the tutorial come back **here** and see the next section for our list of anticipated issues.
*After* completing the second tutorial, come back **here** and continue with the next tutorial [on this page](get-started_3.qmd).
:::{.callout-tip}
## Let's start
Now you can start the second tutorial at <https://quarto.org/docs/get-started/computations/rstudio.html>.
:::
### Possible problems and related comments
- Whenever you copy something from the tutorial website into your own *.qmd* document, always make sure that in RStudio you copy into *Source* mode instead of *Visual* mode. Otherwise, rendering the document will not work correctly because the visual mode adds some extra characters that brake the markdown syntax.
- Note that when using [cell options](https://quarto.org/docs/reference/cells/cells-knitr.html) in an R chunk, there cannot be any empty lines before the options. For example, this does not work:
```{{r}}
#| echo: false
plot(1)
```
- [Code Linking](https://quarto.org/docs/get-started/computations/rstudio.html#code-linking) (`code-link: true`) only works if you manually install the R packages *downlit* and *xml2*.
- The tutorial discusses yaml options (e.g. `df-print: paged`) on how to display [Data Frames](https://quarto.org/docs/get-started/computations/rstudio.html#data-frames) but does not actually print any data.frame in the *.qmd* document. You can add the following chunk to test the different `df-print` options:
```{r}
#| echo: fenced
library(palmerpenguins)
penguins
```
- The section on [Inline Code](https://quarto.org/docs/get-started/computations/rstudio.html#inline-code) mentions both the `` `{r} ` `` and `` `r ` `` syntax. If you plan to use Quarto mostly with R or are already familiar with Rmarkdown/knitr, we recommend using the `` `r ` `` syntax which is more intuitive in more advanced use cases. If you encounter some unexpected behavior, read the documentation [here](https://quarto.org/docs/computations/inline-code.html). The most important difference is that `` `r ` `` treats the output as markdown code while `` `{r} ` `` treats the output as ordinary text.
- When you render the final .qmd document, this will produce an html file (*computations.html*) that you might want to share with some colleagues to show them your new analysis. However, be aware that the html file does not contain all necessary content and will possibly not display correctly on its own. To produce a single standalone .html file that you can share with others, add `embed-resources: true` to the html options in the YAML header. The final .html then should look something like this (there is also an additional option `self-contained-math: true` which tries to make sure that all your equations can be displayed without a connection to the internet):
{{< downloadthis _computations-complete.html dname="computations-complete-standalone" label="Download standalone .html">}}