Report

Author

Ha Nguyen

Quarto

Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see https://quarto.org.

Formula: Insert/Latex Math

Formula 1 (lnline math): \(x^2\)

Formula 2 (display math):

\[ \int_0^2x^2dx \]

\[ \sum_{i=1}^{n}i=\frac{n(n+1)}{2} \]

\[ \lim_{h\to0}\frac{f(x+h)-f(x)}{h} \]

Running Code: Insert/Executable Cell/R

Insert/Executable Cell/R: Option + Command + I

Run code: Command + Enter

1+2
[1] 3
head(mtcars)
                   mpg cyl disp  hp drat    wt  qsec vs am gear carb
Mazda RX4         21.0   6  160 110 3.90 2.620 16.46  0  1    4    4
Mazda RX4 Wag     21.0   6  160 110 3.90 2.875 17.02  0  1    4    4
Datsun 710        22.8   4  108  93 3.85 2.320 18.61  1  1    4    1
Hornet 4 Drive    21.4   6  258 110 3.08 3.215 19.44  1  0    3    1
Hornet Sportabout 18.7   8  360 175 3.15 3.440 17.02  0  0    3    2
Valiant           18.1   6  225 105 2.76 3.460 20.22  1  0    3    1
library(ggplot2)
ggplot(mtcars, aes(mpg,hp)) +
  geom_point() + 
  geom_smooth(method = "lm", se = F)
`geom_smooth()` using formula = 'y ~ x'

Print

When you click the Render button a document will be generated that includes both content and the output of embedded code. You can embed code like this:

1 + 1
[1] 2

You can add options to executable code like this

[1] 4

The echo: false option disables the printing of code (only output is displayed).

Export

  1. Send html file on Desktops/R/Chapter9/Chapter 9 report.html
  2. Render/share link
  3. Publish/RPub
  • Làm slide cũng khá hay