---
title: "Title"
author: "[John Zobolas](https://github.com/bblodfon)"
date: "Last updated: `r format(Sys.time(), '%d %B, %Y')`"
output:
  html_document:
    css: style.css
    theme: united
    toc: true
    toc_float:
      collapsed: false
      smooth_scroll: true
    toc_depth: 3
    number_sections: false
    code_folding: hide
    code_download: true
bibliography: references.bib
link-citations: true
---

# Intro {-}

Template based on [Rmarkdown](https://bookdown.org/yihui/rmarkdown/), using the [united HTML theme](https://bootswatch.com/united/).

Refer to a [sub section](#sub-analysis). 
Citing an article [@article]. 
Refer to section [Analysis].

# Input {-}

Loading libraries:
```{r Load libraries, message = FALSE}
library(DT)
library(ggplot2)
library(xfun)
```

# Analysis {-}

`Vestibulum` imperdiet^[Nullam quis sem nunc], ex vel sodales facilisis, nibh tellus imperdiet massa, sit amet scelerisque orci velit vel tellus. Ut consequat justo tincidunt porttitor varius. Suspendisse erat ipsum, feugiat vitae rhoncus non, molestie ac purus. Morbi aliquet, elit eget blandit suscipit, est lacus facilisis turpis, nec fermentum nunc felis et lorem.

::: {#Table1}
A nice table example:
:::

```{r}
DT::datatable(mtcars, options = list(pageLength = 3))
```

## Sub analysis {-}

> Suspendisse potenti

We can have math formulas inline like this: $E=mc^2$ or make them span an entire line like this:

::: {#eq1} 
:::

$$f=\frac{a}{b+c}$$

**Create a horizontal line** using [markdown syntax](https://commonmark.org/help/):

----

Cras pulvinar ligula ac nisi porttitor, volutpat congue orci tincidunt. Pellentesque non mi congue, porta enim eget, venenatis sem. Integer suscipit vulputate tellus, eget commodo dolor gravida vel. Suspendisse gravida gravida ligula, in interdum sapien molestie ut.

### Yet another analysis {-}

::: {.blue-box}
In ut vehicula risus.
Refer to the [table](#Table1) above!
:::

```{r example plot, warning = FALSE, fig.align='center'}
options(scipen=999)  # turn-off scientific notation like 1e+48
theme_set(theme_bw())  # pre-set the bw theme.
data("midwest", package = "ggplot2")
# midwest <- read.csv("http://goo.gl/G1K41K")  # bkup data source

# Scatterplot
gg = ggplot(midwest, aes(x=area, y=poptotal)) + 
  geom_point(aes(col=state, size=popdensity)) + 
  geom_smooth(method="loess", se=F) + 
  xlim(c(0, 0.1)) + 
  ylim(c(0, 500000)) + 
  labs(subtitle="Area Vs Population", 
       y="Population", 
       x="Area", 
       title="Scatterplot", 
       caption = "Source: midwest")

plot(gg)
```

Remember [equation 1](#eq1)!

# Conclusion {-}

::: {#box1 .green-box}
Wrapping it up!
:::

::: {#box2 .info-box .caution}
- *Cras tincidunt* felis venenatis pretium iaculis^[In eget eros sit amet leo feugiat consequat]. 
- Curabitur in **tortor at tellus** fermentum elementum vel quis sem.
- That sums it up!
:::

::: {#box3 .info-box .warning}
Be careful, be gentle, be brave! 
And remember the above [box!](#box1)
:::

::: {.info-box .tip}
A tip!
:::

::: {.info-box .note}
A note!
:::

::: {.info-box .important}
I have something **important** to say here!
:::

::: {#box4 .orange-box}
An orange box!!!
:::

# R session info {-}

```{r session info, comment=""}
xfun::session_info()
```

# References {-}
