getDayNight: Classify the time stamps of a track into 'day' and 'night'...

Description Usage Arguments Value Examples

Description

This function classifies the time stamps of a track into day and night categories according to the local sunrise and sunset times.

Usage

1
2
getDayNight(time.stamp, coord,
  proj = sp::CRS("+proj=longlat +datum=WGS84"))

Arguments

time.stamp

vector with the date and time of the detections, in POSIXt format.

coord

a data.frame or matrix object with a unique pair of coordinates or with a pair of coordinates for each time stamp ('x' and 'y' columns with the coordinates).

proj

CRS object with the reference system of the coordinates, by default longlat WGS84.

Value

a character vector with a 'D' (day) or 'N' (night) label for each time stamp.

Examples

1
2
3
4
times <- Sys.time() + seq(-48, 48, 12) * 3600
coord <- cbind(x =  42.04818, y = 3.19555)
daynight <- getDayNight(times, coord)
daynight

aspillaga/fishtrack3d documentation built on June 4, 2019, 9:14 a.m.