Learn R Programming

amt (version 0.2.2.0)

time_of_day: Time of the day when a fix was taken

Description

A convenience wrapper around suncalc::getSunlightTimes to annotate if a fix was taken during day or night (optionally also include dawn and dusk).

Usage

time_of_day(x, ...)

# S3 method for track_xyt time_of_day(x, include.crepuscule = FALSE, ...)

# S3 method for steps_xyt time_of_day(x, include.crepuscule = FALSE, where = "end", ...)

Value

A tibble with an additional column tod_ that contains the time of the day for each relocation.

Arguments

x

[track_xyt,steps_xyt]
A track or steps.

...

Further arguments, none implemented.

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

Run this code
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")

Run the code above in your browser using DataLab