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

Description Usage Arguments Value Examples

View source: R/getDayNight.R

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
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 Oct. 17, 2018, 11:12 p.m.