forked from ucsb-bren/ESM296-3W-2016
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgmcdonald-sfg.Rmd
112 lines (89 loc) · 3.55 KB
/
gmcdonald-sfg.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
---
title: "Gavin's Student Webpage"
author: "Gavin McDonald"
date: "January 19, 2016"
output:
html_document:
toc: true
toc_depth: 2
---
## Content
I work with the Fish Forever initiative ([Fish Forever](http://www.fishforever.org)), a partnership between the Sustainable Fisheries Group at UCSB, Rare, and Environmental Defense Fund, aimed at improving management of small-scale fisheries in the developing tropics through the use of TURF-reserves.
![](images/gmcdonald-sfg_FF_Logo.png)
One of the most critical challenges we face is assessing and managing fisheris in the data- and resource-limited situations where we work. To address this, we are using data-limited assessment techniques to creatively work with the data that we do have. However, no single technique is perfect, so we are therefore using multiple techniques to examine each fishery so that we can have a more complete understanding of how the fishery is performing. I therefore have two main research questions:
1. How can multiple data-limited assessment techniques, which might each give conflicting indications for how a fishery is doing, be interpreted and synthesized to make better management decisions for a fishery?
2. How does including uncertainty, both in measurement error and life history information error, affect the interpretation and synthesis of multiple indicators?
## Techniques
To address this question, I will apply multiple data-limited assessment techniques to a single data set including:
* LBAR (for calculating fishing mortality)
* Catch Curve (for calculating fishing mortality)
* LBSPR (for calculating length-based spawning potential ratio)
* Froese sustainability indicators (for calculating percent mature, percent optimal, and percent megaspawner)
* Trends in Catch and CPUE
## Data
The data set I will be using is from Karimunjawa National Park, Indonesia. This site is a prototype site for the Fish Forever intervention. The data set runs from 2010-2015 and includes catch, effort, and length-composition data. Wildlife Conservation Society (WCS) and Rare contributed to the data collection of this data set.
![](images/karimunjawa.jpg)
## Data Wrangling
Working in R and the terminal
```{r, eval=FALSE}
# present working directory
getwd()
# change working directory
setwd('.')
# list files
list.files()
# list files that end in '.jpg'
list.files(pattern=glob2rx('*.jpg'))
# file exists
file.exists('test.png')
setwd('students')
```
Installing packages
```{r, eval=FALSE}
# Run this chunk only once in your Console
# Do not evaluate when knitting Rmarkdown
# list of packages
pkgs = c(
'readr', # read csv
'readxl', # read xls
'dplyr', # data frame manipulation
'tidyr', # data tidying
'nycflights13', # test dataset of NYC flights for 2013
'gapminder') # test dataset of life expectancy and popultion
# install packages if not found
for (p in pkgs){
if (!require(p, character.only=T)){
install.packages(p)
}
}
```
Reading in csvs with utils::read.csv
```{r, eval=FALSE}
d = read.csv('../data/r-ecology/species.csv')
d
head(d)
summary(d)
```
Reading in csvs with readr::read_csv
```{r,eval=FALSE}
library(readr)
d = read_csv('../data/r-ecology/species.csv')
d
head(d)
summary(d)
```
Formatting tables with dplry::tbl_df
```{r,eval=TRUE}
library(readr)
library(dplyr)
d = read_csv('../data/r-ecology/surveys.csv') %>%
tbl_df() %>%
select(species_id,year) %>%
#filter(species_id == "NL") %>%
group_by(species_id,year) %>%
summarize(count = n())
d
head(d)
summary(d)
glimpse(d)
```