-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdata.Rmd
68 lines (59 loc) · 1.55 KB
/
data.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
---
title: "Data"
output:
html_document:
include:
before_body: header.html
---
We will be modeling and forecasting catch data however you can use the techniques we will learn on any regularly spaced time data.
```{r load_data, fig.align = "center", fig.height = 4, fig.width = 8, warning=FALSE, echo=FALSE}
library(ggplot2)
load("landings.RData")
landings$log.metric.tons = log(landings$metric.tons)
ggplot(landings, aes(x=Year, y=log.metric.tons)) +
geom_line() + geom_point() +
facet_wrap(~Species)
```
## Data Format
Your data should be in a simple csv (comma-separated) file with time (year, day, month, etc) and value:
```
Year, metric.tons
1964, 5449.2
1965, 4263.5
1966, 5146.4
1967, 7271.5
1968, 6352.5
```
If you have different locations or species, add that as a new column.
```
Year, metric.tons, species
1964, 5449.2, Anchovy
1965, 4263.5, Anchovy
1966, 5146.4, Anchovy
1967, 7271.5, Anchovy
1968, 6352.5, Anchovy
1964, 5449.2, Sardine
1965, 4263.5, Sardine
1966, 5146.4, Sardine
1967, 7271.5, Sardine
1968, 6352.5, Sardine
```
Here is an example with species and location.
```
Year, metric.tons, species, region
1964, 5449.2, Anchovy, North
1965, 4263.5, Anchovy, North
1966, 5146.4, Anchovy, North
1967, 7271.5, Anchovy, North
1968, 6352.5, Anchovy, North
1964, 5449.2, Sardine, North
1965, 4263.5, Sardine, North
1966, 5146.4, Sardine, North
1967, 7271.5, Sardine, North
1968, 6352.5, Sardine, North
1964, 5449.2, Sardine, South
1965, 4263.5, Sardine, South
1966, 5146.4, Sardine, South
1967, 7271.5, Sardine, South
1968, 6352.5, Sardine, South
```