ExtractData: Filter a Subset of Data from a VTrack File

Description Usage Arguments Value Author(s) See Also Examples

Description

ExtractData enables the user to extract/remove a subset of data (i.e. transmitters, receivers, stations and time period) from the file. For dual sensor data, this function also allows the user to extract sensor only data (i.e. temperature or depth data) from the file.

Usage

1
2
3
ExtractData(sInputFile, sQuerySTARTTIME = NULL, sQueryENDTIME = NULL, 
  sQueryTransmitterList = NULL, sQueryReceiverList = NULL, 
  sQueryStationList = NULL, sQueryDataType = NULL)

Arguments

sInputFile

a data frame containing VTrack-transformed acoustic tracking data

sQuerySTARTTIME

an optional POSIXct string specifying the date/time start point from which data will be extracted from the original file. Date and time must be in the format 'yyyy-mm-dd HH:MM:SS'. Default is NULL

sQueryENDTIME

an optional POSIXct string specifying the date/time end point from which data will not be extracted from the original file. Date and time must be in the format 'yyyy-mm-dd HH:MM:SS'. Default is NULL

sQueryTransmitterList

an optional character string specifying the individual transmitters to be extracted from the original file. Default is NULL

sQueryReceiverList

an optional character string specifying the receivers to be extracted from the original file. Default is NULL

sQueryStationList

an optional character string specifying the stations to be extracted from the original file. Default is NULL

sQueryDataType

an optional character string specifying the sensor data type (e.g. depth m) to be extracted from the original file. Default is NULL

Value

Subsets the original a data frame returning the following components:

DATETIME

a vector of class POSIXct of the time of location fix of type 'yyyy-mm-dd HH:MM:SS'

TRANSMITTERID

a numeric vector giving the identity of each transmitter (= ID)

SENSOR1

a numeric vector containing the value of the environmental sensor (i.e. temperature or depth) at the time of detection

UNITS1

a character vector containing the units of each sensor value (e.g. m)

TRANSMITTERID

a character vector containing the identity of each transmitter (= ID or tag ID)

RECEIVERID

a character vector containing the factory assigned receiver serial number (= Receiver S/N or receiver ID)

STATIONNAME

a character vector containing the user defined station name (= Station.Name or station name)

Author(s)

Ross Dwyer, Mathew Watts, Hamish Campbell

See Also

ExtractUniqueValues

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Load the crocodile data set
data(crocs)

# Convert data into the VTrack archive format
Vcrocs <- ReadInputData(infile=crocs,
                        iHoursToAdd=10,
                        dateformat = NULL,
                        sVemcoFormat='1.0')

# Extract list of transmitters from test archive 1
(TransmitterList <- ExtractUniqueValues(Vcrocs,2))  

# Plot the detections against time for each TRANSMITTERID
par(mfrow=c(1,1),las=1,bty="l")
plot(as.Date(Vcrocs$DATETIME), as.numeric(as.factor(as.numeric(as.character(
	Vcrocs$TRANSMITTERID)))),
     ylab="TRANSMITTERID",xlab="DATETIME",
     yaxt="n",pch=16,cex=0.7)
axis(side=2, at=seq(1,length(TransmitterList),1),
     labels = TransmitterList[order(as.numeric(
	TransmitterList))])

# For TRANSMITTERID 139 plot the detections against time for each RECEIVERID 
par(mfrow=c(1,1),las=1,bty="l")
T139 <- ExtractData(Vcrocs,sQueryTransmitterList = c("139"))

# Extract data from TRANSMITTERID 139 and plot raw sensor data
par(mfrow=c(1,1),las=1,bty="l")
plot(T139$SENSOR1~
	T139$DATETIME,xlab="Date",
	ylab="Depth (m)",main=unique(T139[,2]),
	pch=16,cex=0.7)

# Extract depth only data for a certain time period.
#Vcrocs_Depth <- ExtractData(Vcrocs,
#	sQueryDataType = "m",
#	sQuerySTARTTIME = "2008-08-01 21:00:00",
#	sQueryENDTIME = "2009-10-31 23:03:00")  

VTrack documentation built on May 2, 2019, 9:16 a.m.