Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

time_of_day

Time of the day when a fix was taken


Description

A convenience wrapper around maptools::sunriset and maptools::crepuscule to extract if a fix was taken during day or night (optionally also include dawn and dusk).

Usage

time_of_day(x, ...)

## S3 method for class 'track_xyt'
time_of_day(x, solar.dep = 6, include.crepuscule = FALSE, ...)

## S3 method for class 'steps_xyt'
time_of_day(x, solar.dep = 6, include.crepuscule = FALSE, where = "end", ...)

Arguments

x

[track_xyt,steps_xyt]
A track or steps.

...

Further arguments, none implemented.

solar.dep

[numeric(1,n)=6]
The angle of the sun below the horizon in degrees. Passed to maptools::crepuscule.

include.crepuscule

[logical(1)=TRUE]
Should dawn and dusk be included.

where

[character(1)="end"]{"start", "end", "both"} For steps, should the start, end or both time points be used?

Examples

data(deer)
deer %>% time_of_day()
deer %>% steps_by_burst %>% time_of_day()
deer %>% steps_by_burst %>% time_of_day(where = "start")
deer %>% steps_by_burst %>% time_of_day(where = "end")
deer %>% steps_by_burst %>% time_of_day(where = "both")

amt

Animal Movement Tools

v0.1.4
GPL-3
Authors
Johannes Signer [aut, cre], Brian Smith [ctb], Bjoern Reineking [ctb], Ulrike Schlaegel [ctb], John Fieberg [ctb], Scott LaPoint [dtc]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.