-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquack_quack.Rmd
88 lines (62 loc) · 2.13 KB
/
quack_quack.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
78
79
80
81
82
83
84
85
86
---
title: "Quack Quack"
author: "Count Duckula"
date: "27 June 2018"
output:
html_document:
includes:
in_header: "partials/header.html"
---
![Count Duckula](img/duckula.png "the great count duckula")
defaults for all chunks set here.
add css class of language_r to all source code chunks
prism javascript and css library will use that class to do highlighting.
```{r setup, include=TRUE}
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_chunk$set(eval = TRUE)
knitr::opts_chunk$set(class.source = c("language-r"))
```
Clone the repository https://github.com/adam-gruer/quack_quack.git
The following folders and files are required in your project
in order for quack_quack.rmd to knit to html correctly:
<pre>
your_project
| quack_quack.rmd
|
+---partials
| header.html
|
+---scripts
| prism.js
|
\---themes
prism.css
</pre>
### Example quack_quack code.
chunks given the non-existent language <code>quack_quack</code>
r markdown complains and doesn't/can't run the code but **will** print the code
block!
When you have replaced the occurrences of <code class="language-r">
<span class=".token.dataset">some_dataset</span></code> and <code class="language-r">
<span class=".token.dataset">column_name</span></code>, your code will be ready to run, almost! Replace <code>{quack_quack}</code> with <code>{r}</code> and you are good to go.
```{quack_quack}
library(ggplot2)
some_dataset %>%
ggplot(aes(x = column_name, y = column_name)) +
geom_point() # Adds a scatterplot.
```
### Example non quack_quack code
```{r }
library(ggplot2)
library(magrittr)
boot::ducks %>%
ggplot(aes(x = plumage, y = behaviour)) +
geom_point(aes(colour = plumage), size = 7, alpha = 0.7) + # Adds a scatterplot.
geom_smooth( colour = "#005c47",method = "lm", se = FALSE) + #adds regression line
labs(title = "If it looks like a duck",
subtitle = "Behavioral and Plumage Characteristics of Hybrid Ducks",
x = "Looks like: Mallard <-> Pintail",
y = "Acts like: Mallard <-> Pintail")+
theme_minimal() +
scale_color_continuous(low = "#005c47", high = "#5f4433", guide = "none")
```