read.wc: Read and format tag data

Description Usage Arguments Value Examples

View source: R/read.wc.r

Description

read.wc reads and formats tag data output from Wildlife Computers Data Portal

Usage

1
read.wc(ptt, filename, tag, pop, type = "sst", verbose = FALSE)

Arguments

ptt

is individual ID number

filename

is path to the file where your data lives

tag

is POSIXct object of the tagging date

pop

is POSIXct object of the pop-up date

type

is character indicating which type of data to read. Choices are 'sst', 'pdt', 'light' corresponding to those data files output from WC Data Portal

verbose

is logical indicating whether a verbose output with more details on the loaded files is desired. Default is FALSE.

Value

a list containing: the data read as a data.frame and a date vector of unique dates in that data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# example data in the package
sstFile <- system.file("extdata", "141259-SST.csv", package = "HMMoce")
ptt <- 141259

# set temporal and spatial bounds
iniloc <- data.frame(matrix(c(13, 10, 2015, 41.3, -69.27, 10, 4, 2016, 40.251, -36.061),
 nrow = 2, ncol = 5, byrow = TRUE))
 names(iniloc) <- list('day','month','year','lat','lon')
 tag <- as.POSIXct(paste(iniloc[1,1], '/', iniloc[1,2], '/', iniloc[1,3], sep=''), 
 format = '%d/%m/%Y', tz='UTC')
 pop <- as.POSIXct(paste(iniloc[2,1], '/', iniloc[2,2], '/', iniloc[2,3], sep=''), 
 format = '%d/%m/%Y', tz='UTC')

# read and format the example data
tag.sst <- read.wc(ptt, sstFile, type = 'sst', tag=tag, pop=pop)

HMMoce documentation built on Nov. 17, 2017, 5:57 a.m.