Learn R Programming

HMMoce (version 1.0.0)

read.wc: Read and format tag data

Description

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

Usage

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

Run this code
# NOT RUN {
# 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)
# }

Run the code above in your browser using DataLab