Preamble

The code in this Rmarkdown document imports some vms data and produces a clean VMS dataset with the same column names so it can be used with the other Rmarkdown documents. The output format includes the following five columns:

Input parameters (user specification)

# ------------------------------------------------------------------------------
# 1. IMPORTING AND STANDARDIZATION
#
# Country name -----------------------------------------------------------------
#              Current choices: "Ghana", "Liberia", "Sierra Leone", "Iceland"
country <- "Iceland"  
#
# Path and file name of data to import -----------------------------------------
file.in = "data-raw/iceland_vms.csv"
#
# Path and file name for the output file (standardized format) -----------------
file.out = "data-tidy/VMS_standardized.csv"
knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE)
# Needed libaries
library(tidyverse)
library(ghsllr)
vms <- vms_import_data(file.in, country)
vms %>%
  dplyr::select(vid, date, lon, lat, speed, country) %>%
  mutate(date = as.character(date)) %>%
  write_csv(file.out)

Data summary

vms %>%
  vms_data_summary() %>% 
  knitr::kable()

vms_plot_speed(vms)

Vessel summary

vms %>%
  vms_vessel_summary() %>% 
  knitr::kable()


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