This repository has been archived by the owner on Feb 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.Rmd
94 lines (60 loc) · 2.55 KB
/
README.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
87
88
89
90
91
92
93
94
---
output: github_document
always_allow_html: yes
---
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# WhaleSafe4r
<p align="center">
<img width="460" height="300" src="./man/figures/floaty.gif">
</p>
## Table of Contents
[Installation](#installation)
[Overview](#overview)
[Crawlers](#crawlers)
[Readers](#readers)
[Updaters](#updaters)
[Stats](#stats)
The WhaleSafe4r package harvests AIS data located at [this site](https://ais.sbarc.org/), which are collected and
maintained by the [Santa Barbara Amateur Radio Club | K6TZ](https://www.sbarc.org/). The data is then written to a postgres database and analyzed in order to generate vessel speed report cards.
<a name="installation"/>
## Installation
You can install the released version of whaletrails from: [Github](https://github.com/BenioffOceanInitiative/whalesafe4r) with:
```{r installation, eval=FALSE}
devtools::install_github("BenioffOceanInitiative/whalesafe4r")
```
<a name="overview"/>
## Overview
The primary areas our functions address are:
<a name="crawlers"/>
## Crawlers
1) [Crawlers](https://github.com/BenioffOceanInitiative/whalesafe4r/blob/master/R/crawlers.R)
Get a list of URL's from Santa Barbara Amatuer Radio Club and use the Reader and Updater functions to get the AIS data into a relational database.
<a name="readers"/>
## Readers
2) [Readers](https://github.com/BenioffOceanInitiative/whalesafe4r/blob/master/R/readers.R)
Reads a URL path into AIS data ([example](https://ais.sbarc.org/logs_delimited/2018/180101/AIS_SBARC_180101-00.txt)) & constructs a spatial features dataframe from the AIS dataframe.
```{r, include = FALSE}
# library(dplyr)
# library(leaflet)
# map <- readRDS("~/github/whalesafe4r/data/segs_map.rds")
#
# map
```
<p align="center">
<img width="460" height="300" src="./man/figures/segments.png">
</p>
<a name="updaters"/>
## Updaters
3) [Updaters](https://github.com/BenioffOceanInitiative/whalesafe4r/blob/master/R/update_ais.R)
Loops through the list of URL's from the crawlers functions to make an AIS dataframe. Then it makes a sf dataframe with each vessels track from the AIS dataframe. Finally, it intersects the sf dataframe of all vessel tracks with the VSR Zones based on space and time.
<a name="stats"/>
## Stats
4) [Stats](https://github.com/BenioffOceanInitiative/whalesafe4r/blob/master/R/seg_stats.R)
Calculates Statistics for each vessel and Operator to determine cooperation grades with the Vessel Speed Reduction programs.