I have tracking data (coordinates, date and time) of an animal, and I want to select the data between sunset and sunrise. As the data are from different areas and months, the time of sunrise and sunset varies.
With getSunlightTimes
(from {suncalc}
) I added the time of sunrise and sunset of the specific place and date as columns.
Now I have to select the data points where the time lies between sunset and sunrise. How can I do this?
I tried it with normal subsets and other ways of filtering data and with the columns as POSIXct
, but it didn’t work out.
Verena Rupprecht is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
3