-
Notifications
You must be signed in to change notification settings - Fork 13
/
00-Getting-started.Rmd
executable file
·30 lines (20 loc) · 1.31 KB
/
00-Getting-started.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
---
title: "Preliminaries"
output: html_notebook
editor_options:
chunk_output_type: inline
---
<!-- This file by Charlotte Wickham is licensed under a Creative Commons Attribution 4.0 International License. -->
```{r setup, include = FALSE}
library(tidyverse)
```
## R notebooks
This is an [R Markdown](http://rmarkdown.rstudio.com) Notebook. When you execute code within the notebook, the results appear beneath the code.
R code goes in **code chunks**, denoted by three backticks. Try executing this chunk by clicking the *Run* button within the chunk or by placing your cursor inside it and pressing *Crtl+Shift+Enter* (Windows) or *Cmd+Shift+Enter* (Mac).
```{r}
ggplot(data = mpg) +
geom_point(mapping = aes(x = displ, y = hwy))
```
Add a new chunk by clicking the *Insert* button on the toolbar, then selecting *R* or by pressing *Ctrl+Alt+I* (Windows) or *Cmd+Option+I* (Mac).
When you save the notebook, an HTML file containing the code and output will be saved alongside it (click the *Preview* button or press *Ctrl+Shift+K* (Windows) or *Cmd+Shift+K* (Mac) to preview the HTML file).
The preview shows you a rendered HTML copy of the contents of the editor. Consequently, unlike *Knit*, *Preview* does not run any R code chunks. Instead, the output of the chunk when it was last run in the editor is displayed.