In the shell:
git clone https://github.com/hadley/adv-r.git
gem install jekyll mime-types
In R:
# Use the devtools package (on CRAN) to get the most up to date version of rICES package (very much in the works) here: | |
# https://github.com/ices-dk | |
devtools::install_github("ICES-dk/rICES", force = TRUE) | |
library(rICES) | |
# You can get the HL, HH, or CA "EXCHANGE" data using the following function. HH is info on the haul (used to calculate a survey index) | |
# and HL is the length data. CA is for age info. | |
# You can make a loop or a function to get data from other surveys. Let it run overnight because there is a lot of data!!! | |
d <- getDATRAS(record = "HL", | |
survey="NS-IBTS", | |
startyear = 2010, |
In the shell:
git clone https://github.com/hadley/adv-r.git
gem install jekyll mime-types
In R:
tt <- data.frame(YEAR = seq(1981, 2010, by = 1), | |
INDICATOR = rnorm(n = 30)) | |
library(zoo) | |
dolm <- function(x) { | |
SE <- summary(lm(INDICATOR ~ ., data = as.data.frame(x)))$sigma | |
SLOPE <- summary(lm(INDICATOR ~ ., data = as.data.frame(x)))$coefficients[1] | |
return(list(standard.error = SE, slope = SLOPE)) | |
} |
rm(list = ls()) | |
# Downloads and parses Calinus finmarchicus abundance data from EMODnet OOPS for the Greater North Sea | |
# 10 yr rolling mean and 1 yr seasonal data are provided. The latter is probably most relevant for fisheries applications. | |
# Citation for data: "European Marine Observation Data Network (EMODnet) Biology project (www.emodnet-biology.eu), funded by the European Commission's Directorate - General for Maritime Affairs and Fisheries (DG MARE)" | |
# | |
#Install package | |
install.packages("jsonlite") | |
library(jsonlite) | |
# | |
emodDatJSON <- fromJSON("http://geo.vliz.be/geoserver/Emodnetbio/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=Emodnetbio:OOPS_summaries&outputFormat=json") |
library(dplyr) | |
tt <- read.csv("~/AreasEcoregionsStocks.csv", | |
stringsAsFactors = FALSE) | |
td <- tt %>% | |
select(StockCode, Ecoregion1_major, Ecoregion2_minor, Ecoregion3_more_minor) %>% | |
melt(id.vars = "StockCode") %>% | |
select(-variable) %>% | |
filter(value != 0) %>% | |
distinct() |
rm(list = ls()) | |
# | |
library(dplyr, quietly = TRUE) | |
library(reshape2, quietly = TRUE) | |
library(ggplot2, quietly = TRUE) | |
# | |
options(scipen = 5) | |
# | |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # | |
# DATA SOURCE: ICES official catch statistics (2006-2014) # |
############################ | |
# How many pages of Advice # | |
############################ | |
##SOURCE | |
#----pdftools package | |
#https://cran.rstudio.com/web/packages/pdftools | |
#INSTALL PACKAGES | |
#install.packages("pdftools", dependencies=TRUE) #only once |
rm(list = ls()) | |
library(data.table) | |
# Unzip each of the InterCatch download files to a folder "/data" in your working directory | |
wd <- getwd() | |
file_list <- paste0(wd, | |
"/data/", | |
grep("CatchAndSampleDataTables.txt", | |
list.files("data/", recursive = TRUE), |
--- | |
title: "UK Salmon" | |
author: "" | |
date: "28 March 2017" | |
output: | |
pdf_document: default | |
html_document: default | |
--- | |
```{r setup, include=FALSE} |