readTDR {diveMove} | R Documentation |
Read a comma delimited (*.csv) file containing time-depth
recorder (TDR) data from various TDR models. Models supported are
MK5, MK7, and MK8 Wildlife Computers instruments. Return a
TDR
or TDRvel
object. buildTDR
creates an object
of one of these classes from other objects in the session.
readTDR(file, dateCol=1, timeCol=2, depthCol=3, velCol=6, subsamp=5, dtformat=c("d/m/y", "h:m:s")) createTDR(time, depth, vel, dtime, file)
file |
A string indicating the path to the file to read. |
dateCol |
Column number containing dates, and optionally, times. |
timeCol |
Column number with times. |
depthCol |
Column number containing depth readings. |
velCol |
Column number containing velocity readings. |
subsamp |
Subsample rows in file with subsamp
interval, in s. |
dtformat |
a character vector of length 2, specifying the format
of the date and time columns, in that order. See
chron for valid format specifications. |
time |
a chron object |
depth |
numeric vector with depth readings |
vel |
optional numeric vector with velocity readings |
dtime |
sampling interval used in chron units (d) |
The file name must contain the adjacent letter “mk” somewhere to be able to identify the TDR model. If the number following these letters is an 8, then a column for velocity readings is expected, in addition to depth.
The file must have a header row identifying each field, and all rows must be complete (i.e. have the same number of fields). Field names need not follow any convention. However, depth and velocity should preferably be given in m, and m/s for further analyses.
An object of class ‘TDR’ or ‘TDRvel’.
Sebastian P. Luque spluque@gmail.com
readTDR(system.file(file.path("data", "sealMK8.csv"), package="diveMove"))