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:
# ------------------------------------------------------------------------------ # 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)
vms %>% vms_data_summary() %>% knitr::kable() vms_plot_speed(vms)
vms %>% vms_vessel_summary() %>% knitr::kable()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.