Getsunlighttimes from the suncalc package gives NAs for "night" and nightEnd" times before 23/07/2023 in R

27 Views Asked by At

I have a dataframe "diel" with dates ranging from 25/05/2023 to 16/09/2023 and longitude latitude coordinates referring to 5 points within the North Sea.

I used the following code:

sun <- getSunlightTimes(data = diel,
                        keep = c("nightEnd", "sunrise", "sunset", "night"), tz = "UTC") 

Somehow I get NAs for all nightEnd and night times ranging from 25/05/2023 to 22/07/2023 while sunrise and sunset work perfectly. I have tested this with "nauticalDawn" and "nauticalDusk" and here the problem also doesn't occur.

I tried to change the timezone and verify the date format of the date column but the problem persists.

0

There are 0 best solutions below