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 TDRspeed
object. buildTDR
creates an object of one of
these classes from other objects in the session.
readTDR(file, dateCol=1, timeCol=2, depthCol=3, speedCol=6, subsamp=5, dtformat="%d/%m/%Y %H:%M:%S", tz="GMT") createTDR(time, depth, speed, 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. |
speedCol |
Column number containing speed readings. |
subsamp |
Subsample rows in file with subsamp
interval, in s. |
dtformat |
A string, specifying the format in which the date and
time columns, when pasted together, should be interpreted (see
strptime ). |
tz |
A string indicating the time zone assumed for the date and time readings. |
time |
a POSIXct object with date and time readings for
locations. |
depth |
numeric vector with depth readings. |
speed |
optional numeric vector with speed readings. |
dtime |
sampling interval used in seconds. |
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 speed 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 speed should preferably be given in m, and m/s for further analyses.
An object of class ‘TDR’ or ‘TDRspeed’.
Sebastian P. Luque spluque@gmail.com
readTDR(system.file(file.path("data", "sealMK8.csv"), package="diveMove"))