-
Notifications
You must be signed in to change notification settings - Fork 0
/
Play_with_Quarto.qmd
106 lines (82 loc) · 2.12 KB
/
Play_with_Quarto.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
title: "Play with Quarto v. 1.4"
date: last-modified
author: Charalampos A. Lazaris
toc: true
toc-depth: 2
format:
gfm: default
html:
theme: cerulean
embed-resources: true
fontsize: 1.5em
code-line-numbers: true
code-overflow: scroll
code-fold: show
highlight-style: tango
keywords: ["Quarto", "tutorial", "R"]
---
# Introduction
This is a Quarto tutorial based on the official Posit cheatsheet. It features some of the new features in Quarto v. 1.4.
# Code
Let's insert some inline code in R: `{r} p <- 1 + 1` gives `{r} p`
Here is some `R` code:
```{r}
p <- 1 + 1
print(p)
```
Now, let's import some data and create a graph, after loading the required libraries:
```{r}
#| warning: false # Do not display warnings
library(tidyverse)
```
```{r}
data(iris)
glimpse(iris)
```
We now plot `Petal.Length` vs. `Petal.Width`:
```{r}
#| fig-align: center
#| fig-height: 6
#| fig-width: 8
#| fig-cap: "Petal length vs. petal width in iris species"
ggplot(data = iris, aes(x = Petal.Width, y = Petal.Length)) +
geom_point() +
geom_smooth(method = "lm", se = TRUE) +
ggtitle("Petal length vs. petal width") +
xlab("Petal width") + ylab("Petal length") +
theme_bw()
```
::: {.callout-tip title="Consistency" collapse="false"}
Use `dplyr` for data wrangling and `ggplot2` for plotting - keep it consistent
:::
## `Markdown` formatting:
Here is some **bold** text and here is some text in *italics*. We can also <u>text</u> or strikethrough text: ~~hello~~. We can also create some lists. Let's start with a numbered list:
1. First
2. Second
3. Third
Now, let's make the same list, nested:
1. First
1. Hello
2. Hi
3. Ciao
2. Second
3. Third
We can also have unordered lists:
- First
- Hello
- Hi
- Ciao
- 1
- Second
- Third
We can also insert links to URLs: [my website](https://chlazaris.netlify.app) or links to pictures. Here is a photo of my favorite writer:
::: {#fig-camus}
![Camus](https://www.nobelprize.org/images/camus-13118-portrait-mini-2x.jpg)
:::
We can also insert tables:
|ID|Name|Surname|
|--|----|-------|
|1|James|Dean|
|2|Marlon|Brando|
|3|Montgomery|Cliff|