Kapitel 1 HTML formatting

Centered text

More centered text

The contents of the below subsections are located in a sub folder.

1.1 Basic text

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

summary(cars)
##      speed           dist       
##  Min.   : 4.0   Min.   :  2.00  
##  1st Qu.:12.0   1st Qu.: 26.00  
##  Median :15.0   Median : 36.00  
##  Mean   :15.4   Mean   : 42.98  
##  3rd Qu.:19.0   3rd Qu.: 56.00  
##  Max.   :25.0   Max.   :120.00

1.2 Including plots

You can also embed plots, for example:

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.

link to subsection Basic text

1.3 Including images

knitr::include_graphics(normalizePath("../test_images/cbs_logo.png"))
This is CBS' logo

Figure 1.1: This is CBS’ logo

This is section 1.3

See Figure 1.2.

The cars data.

Figure 1.2: The cars data.

Also see Equation (1.1).

\[\begin{equation} \bar{X} = \frac{\sum_{i=1}^n X_i}{n} \tag{1.1} \end{equation}\]

And see Table 1.1.

Table 1.1: The mtcars data.
mpg cyl disp hp drat
Mazda RX4 21.0 6 160 110 3.90
Mazda RX4 Wag 21.0 6 160 110 3.90
Datsun 710 22.8 4 108 93 3.85
Hornet 4 Drive 21.4 6 258 110 3.08
Hornet Sportabout 18.7 8 360 175 3.15

Resultat: Transformation fra \(N(\mu,\sigma)\) til \(t\)

Inserting animations

1.3.1 Example: gifski

Example: plotly

1.3.2 Example: gganimate

1.3.3 Example: gganimate (2nd try)