View source: R/activity_code.r
solartime | R Documentation |
This is a wrapper for transtime
that takes non-numeric date-time input together with latitude and longitude to calculate mean average sunrise and sunset times, which are then used to anchor the transformation using average anchoring.
solartime(
dat,
lat,
lon,
tz,
...,
tryFormats = c("%Y-%m-%d %H:%M:%OS", "%Y/%m/%d %H:%M:%OS",
"%Y:%m:%d %H:%M:%OS", "%Y-%m-%d %H:%M", "%Y/%m/%d %H:%M",
"%Y:%m:%d %H:%M", "%Y-%m-%d", "%Y/%m/%d", "%Y:%m:%d")
)
dat |
A vector of character, POSIXct or POSIXlt date-time values. |
lat, lon |
Single numeric values or numeric vectors the same length as |
tz |
A single numeric value or numeric vector same length as |
... |
arguments passed to as.POSIXlt |
tryFormats |
formats to try when converting date from character, passed to as.POSIXlt |
Time zone tz
should be expressed in numeric hours relative to UTC (GMT).
A list with elements:
input
: event input dates-times in POSIXlt format.
clock
: radian clock time data.
solar
: radian solar time data anchored to average sun rise and sun set times.
Vazquez, C., Rowcliffe, J.M., Spoelstra, K. and Jansen, P.A. in press. Comparing diel activity patterns of wildlife across latitudes and seasons: time transformation using day length. Methods in Ecology and Evolution.
strptime, transtime
data(BCItime)
subdat <- subset(BCItime, species=="ocelot")
times <- solartime(subdat$date, 9.156335, -79.847682, -5)
rawAct <- fitact(times$clock)
avgAct <- fitact(times$solar)
plot(rawAct)
plot(avgAct, add=TRUE, data="n", tline=list(col="cyan"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.