Input parameters

# FILE NAMES -------------------------------------------------------------------
#
# Path and file name of your standardized VMS data
file.name <- "data-tidy/VMS_standardized.csv"
#
# Path and file name of rasterized data to be exported (can then be imported
#      into QGIS)
raster.name <- "data-products/Effort_raster.asc"

# FILTER VALUES ----------------------------------------------------------------
# The standardized VMS file will be filtered according to these specifications
#
# Range of dates to analyze (have to be of the format YYYY-MM-DD HH:MM:SS)
date.lim = c("1901-01-01 00:00:00", "2100-12-31 23:59:59")

# CATEGORIZATION ---------------------------------------------------------------
# Range of speeds considered as fishing
fishing.lim <- c(2, 4.5)

# GRAPH RESOLUTIONS ------------------------------------------------------------
#   Resolution for the effort raster
grid.lim <- c(0.05, 0.05)
knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE)
# Needed libaries
library(mapdata)
library(tidyverse)
library(ghsllr)
vms <- readr::read_csv(file.name)
eff <- 
  vms %>% 
  vms_filter_data(speed.lim = fishing.lim,
                  date.lim = date.lim) %>% 
  vms_rasterize(grid.lim)
vms_plot_raster(eff)
eff %>% vms_export_raster(raster.name)


fishvice/ghsllr documentation built on May 24, 2019, 1:36 a.m.