RchivalTag Tutorial | Part 7 - Simulate Depth Time Series Data

RchivalTag time-series DepthTS simulate dygraphs

In this tutorial we will learn how to simulate depth time series data from a template data set.

Robert K. Bauer http://www2.hawaii.edu/~rkbauer (Hawai’i Institute of Marine Biology
University of Hawai’i at Mānoa)https://scholar.google.com/citations?hl=en&user=J-0_tdbR2tgC
04-28-2021

Getting started | Requirements

To run this tutorial we will need RchivalTag version >= 0.1.5 and oceanmap version >= 0.13. You can find the newest versions of both packages on github

## install or load package
# install.packages("RchivalTag") # from CRAN
# library(xfun)
# install_github("rkbauer/oceanmap") # newest version from github
# install_github("rkbauer/RchivalTag") # newest version from github
library("RchivalTag")

## Package overview and version:
?RchivalTag 
help(package="RchivalTag") ## list of functions
ts_file <- system.file("example_files/104659-Series.csv",package="RchivalTag")
ts_df <- read_TS(ts_file)
ts_df$Serial <- ts_df$DeployID
ts_df$Lon <- 5; ts_df$Lat <- 43
dy_DepthTS(ts_df)

We can use the depth time series illustrated above as a template data set to simulate new depth time series data via the simulate_DepthTS function:

ts_df_sim <- simulate_DepthTS(ts_df) # simulate data

dy_DepthTS(ts_df_sim) # plot simulated data

Note that the simulate_DepthTS function can insert transmission gaps (by default a transmission rate of 90% will be modeled) via the gaps and trate-arguments and introduces further variation in the Depth records (i.e. template depth records of >= 300 will be replaced by values between 100 and 700 m).

ts_df_sim2 <- simulate_DepthTS(ts_df, trate = 70, ref_Depth_lim = 100) # simulate data

dy_DepthTS(ts_df_sim2) # plot simulated data
library(dplyr)
meta <- rbind(ts_df[,names(ts_df_sim)],ts_df_sim,ts_df_sim2) %>%
        group_by(DeployID, Serial, Ptt) %>%
        summarise(dep.date=min(date),pop.date=max(date)) %>%
        as.data.frame()

ts_list <- list(ts_df, ts_df_sim, ts_df_sim2)
names(ts_list) <- meta$Serial

# plot data coverage
plot_data_coverage(x = ts_list,type="ts", meta = meta)

Reuse

Text and figures are licensed under Creative Commons Attribution CC BY 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".

Citation

For attribution, please cite this work as

Bauer (2021, April 28). Marine Biologging & Data Science | Blog: RchivalTag Tutorial | Part 7 - Simulate Depth Time Series Data. Retrieved from http://oceantags.com/posts/RchivalTag_Tutorials_Part7_Simulate_DepthTS/

BibTeX citation

@misc{bauer2021rchivaltag,
  author = {Bauer, Robert K.},
  title = {Marine Biologging & Data Science | Blog: RchivalTag Tutorial | Part 7 - Simulate Depth Time Series Data},
  url = {http://oceantags.com/posts/RchivalTag_Tutorials_Part7_Simulate_DepthTS/},
  year = {2021}
}