The goal of spheniscus is to: - Provides raw and clean data from TDRs devices (time and depth recorder) to get familiar with the format. - Provides functions to clean the TDR data and to obtain diving parameters from the sampled individuals.
This package is to be only on the development version from GitHub.
install.packages("devtools")
devtools::install_github("MiriamLL/spheniscus")
library(spheniscus)
Loads raw data as object.
TDR_raw<-TDR_raw
Loads raw data. Note that columns are not separated on purpose.
Loads all dives during the foraging trip.
TDR_dives<-TDR_dives
Extracts depth data from raw data. In devices TDR (Cefas G5+) the pressure starts to be recorded after the row ‘Data Block 1’ and the last recording is just before ‘Data Block 2’. Therefore, these names were used as separators at row_start and row_end.
TDR_pressure<-extract_pressure(data=TDR_raw,
row_start='Data Block 1',
row_end = 'Data Block 2')
Cuts periods inside the data to have only periods of interest. In the example, the information was obtain from the GPS devices, trip_start is when the individual left the colony and trip_end when it returned.
TDR_trip<-extract_trip(data=TDR_pressure,
timeformat="%d-%m-%Y %H:%M:%S",
trip_start="30-11-2018 20:43:24",
trip_end="01-12-2018 20:16:19")
Creates a plot with the diving profile. Adds a red line for the zero.
plot_depth(TDR_trip = TDR_trip,
depth_column='Pressure',
time_column='daytime')
This function is to correct zeros, if manual correction is needed. In the example below I corrected the zero using -0.80 m. This is to be adjusted accordingly.
TDR_corrected<-correct_zero(TDR_trip = TDR_trip,
depth_column='Pressure',
extra_correction=-0.80)
You can plot the depth again to confirm that the zero was corrected.
plot_depth(TDR_trip = TDR_corrected,
depth_column='corrected_depth',
time_column='daytime')
This function identifies every dive as a individual dive, assigns a number, a mean diving depth, a maximum diving depth, a dive duration, a maximum dive duration. In the example, real dives were considered when the animal was deeper than 3 m from the surface.
TDR_dives<-identify_dives(TDR_corrected=TDR_corrected,
real_dives=3,
depth_column='corrected_depth')
This function calculates the dive parameters from the foraging trip. It includes: - average maximum depth - standard deviation of the maximum depth - maximum depth during the trip - average dive duration - standard deviation of dive duration - maximum dive duration - total number of dives Note Diving depths are in meters, durations are in seconds
dive_parameters<-calculate_diveparams(TDR_dives)
| max_depth_mean | max_depth_sd | max_depth_max | dive_duration_mean | dive_duration_sd | dive_duration_max | n_dives | |-----------------:|---------------:|----------------:|---------------------:|-------------------:|--------------------:|---------:| | 11.7163 | 4.836995 | 39.21 | 18.86549 | 7.438373 | 41 | 565 |
This script is supporting information from a publication by Lerma et al. (in preparation)
Please citate the package as: Lerma, M (2021). Package spheniscus (Version v1.0). Zenodo. http://doi.org/10.5281/zenodo.4709837
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.