-
Notifications
You must be signed in to change notification settings - Fork 0
/
observations.Rmd
84 lines (62 loc) · 2.4 KB
/
observations.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
---
title: "Observations"
output: github_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
For the [Jellyscape](https://github.com/BigelowLab/jellyscape) project observations are drawn from a recent release of unstaged [ECOMON](https://www.fisheries.noaa.gov/about/northeast-fisheries-science-centern) data. We choose the following groups to belong to the gelatinous "jellyscape" although the list is easily modified.
+ *Siphonophores* (siph)
+ *Hydromedusea* (hydrom)
+ *Coelenterates* (coel)
+ *Ctenophores* (ctenop)
+ *Salps* (salps)
These we can read from the [ecomon package](https://github.com/BigelowLab/ecomon) and aggregate these species into a count per 10m^2 or count per 100m^3.
# The observation data
```{r read_ecomon, message=FALSE}
source("setup.R")
x = read_ecomon_spp(form = "sf")
```
For most analyses here we want the same in long form.
```{r long_form}
long = ecomon_to_long(x) |>
glimpse()
```
# Distribution through time
```{r plot_timeseries, warning=FALSE}
ggplot(data = long,
mapping = aes(x = date, y = value)) +
geom_point(alpha = 0.1) +
geom_smooth(method = "loess", formula = "y~x") +
scale_y_continuous(trans='log10') +
facet_wrap(~name)
```
Let's look at coverage by year - note we are counting occurences (absences dropped) which results in the exclusion of `Hydromedusea`.
```{r coverage_by_year, warning=FALSE, message=FALSE}
long = mutate(long, year = as.numeric(format(date, "%Y")),
month = as.numeric(format(date, "%m")))
ggplot(data = filter(long, value > 0),
mapping = aes(year)) +
geom_histogram() +
facet_wrap(~name)
```
And alternative is to look at the observations by month.
```{r coverage_by_month, warning=FALSE, message=FALSE}
ggplot(data = filter(long, value > 0),
mapping = aes(month)) +
geom_histogram(stat = "count") +
scale_x_continuous(breaks = 1:12,
labels = function(x) substring(month.abb[x],1,1)) +
facet_wrap(~name)
```
# Distribution through space
We can read the same data in a spatial form and plot that. Once again, we exclude sample locations where there are abscences.
```{r as_spatial}
long = ecomon_as_sf(filter(long, value > 0))
coast = ne_coastline(scale = "medium", returnclass = "sf") |>
st_crop(long)
ggplot() +
geom_sf(data = long, shape = ".", alpha = 0.3) +
geom_sf(data = coast, color = "orange") +
facet_wrap(~name)
```