-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirst-article-example.Rmd
77 lines (63 loc) · 1.47 KB
/
first-article-example.Rmd
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
---
title: "A Simple First Article"
description: |
A new article created using the Distill format.
author:
- first_name: "Joshua"
last_name: "Cook"
url: https://joshuacook.netlify.app
affiliation: Harvard Medical School
affiliation_url: https://hms.harvard.edu/
orcid_id: 0000-0001-9815-6879
date: "`r Sys.Date()`"
output:
distill::distill_article:
toc: true
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, comment = "#>")
```
Distill is a publication format for scientific and technical writing, native to the web.
Learn more about using Distill for R Markdown at <https://rstudio.github.io/distill>.
## Plots
```{r}
library(plotly)
library(tidyverse)
```
```{r}
set.seed(330)
p <- diamonds %>%
sample_n(50) %>%
ggplot(aes(x = carat, y = depth)) +
geom_point(aes(color = cut, size = price), alpha = 1) +
theme_minimal()
```
```{r, dpi=500}
p
```
### Interactive plots and figures
```{r, fig.asp=1}
ggplotly(p)
```
```{r}
library(leaflet)
leaflet() %>%
addTiles() %>% # Add default OpenStreetMap map tiles
addMarkers(lng = 174.768, lat = -36.852, popup = "The birthplace of R")
```
## Tables
```{r}
mtcars %>%
kableExtra::kbl(digits = 3) %>%
kableExtra::kable_styling(
bootstrap_options = c("striped", "hover", "condensed", "responsive")
)
```
## Equations
$$
y \sim \mathcal{N}(\mu, \sigma) \\
\mu = \alpha + \beta X \\
\alpha \sim \mathcal{N}(0, 5) \\
\beta \sim \mathcal{N}(0, 5) \\
\sigma \sim \text{Exp}(1)
$$