# NOT RUN {
## Setup for calculating light likelihood
# Read the data
locsFile <- system.file("extdata", "141259-Locations-GPE2.csv", package = "HMMoce")
locs <- read.table(locsFile, sep = ',', header = TRUE, blank.lines.skip = FALSE)
# Set spatial and temporal limits
sp.lim <- list(lonmin = -82, lonmax = -25, latmin = 15, latmax = 50)
locs.grid <- setup.locs.grid(sp.lim)
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')
dateVec <- as.Date(seq(tag, pop, by = 'day'))
# Try a calculation
L.light <- calc.gpe2(locs[1,], iniloc, locs.grid, dateVec, errEll=TRUE, gpeOnly=TRUE)
# }
# NOT RUN {
# Full example light calculation
L.light <- calc.gpe2(locs, iniloc = iniloc, locs.grid = locs.grid,
dateVec = dateVec, errEll = TRUE, gpeOnly = TRUE)
# }
Run the code above in your browser using DataLab