03-results-01.Rmd 952 Bytes
Newer Older
ab604's avatar
ab604 committed
1
# First Results {#results-1}
ab604's avatar
ab604 committed
2

3
First results chapter with Figure \@ref(fig:fig1-chunk).
ab604's avatar
ab604 committed
4

5
(ref:mpg-plot) Car engine size versus fuel efficiency. The mpg data contains observations collected by the US Environmental Protection Agency on 38 models of car.
ab604's avatar
ab604 committed
6

7
```{r fig1-chunk,echo=FALSE,fig.cap ='(ref:mpg-plot)', fig.scap='Car engine size versus fuel efficiency',out.extra='',fig.align='center',cache=TRUE,warning=FALSE,fig.pos="H"}
ab604's avatar
ab604 committed
8
9
ggplot(data = mpg) + 
  geom_point(mapping = aes(x = displ, y = hwy, color = class))
10
11
12
13
14
15
16
17
18
```

> **Notes** The caption comes from the text following `(ref:fig1-caption)` and 
this has to be all one line like so:

>`(ref:mpg-plot) Car engine size versus fuel efficiency. The mpg data contains observations collected by the US Environmental Protection Agency on 38 models of car.`

> Whilst the reference number to the figure itself comes from 
the code chunk name `fig1-chunk` inside the referencing syntax `\@ref(fig:fig1-chunk)`.