library(lubridate) library(ggplot2) library(StreamMetabolism) library(xts) library(reshape) library(scales) Egmond_Aan_Zee <- sunrise.set(52.6186114,4.6302431, "2024/01/01", timezone="MET", num.days=370) sunrise <- Egmond_Aan_Zee$sunrise sunset <- Egmond_Aan_Zee$sunset sunrise <- strftime(sunrise, format="%R", tz="MET") sunset <- strftime(sunset, format="%R", tz="MET") Egmond_Aan_Zee["sr"] <- as.POSIXct(sunrise, format = "%H:%M") Egmond_Aan_Zee["ss"] <- as.POSIXct(sunset, format = "%H:%M") Egmond_Aan_Zee["timestamp"] <- align.time(Egmond_Aan_Zee$sunrise, 60*10) Egmond_Aan_Zee <- Egmond_Aan_Zee[c("timestamp", "sr", "ss")] locsrss <- ggplot(Egmond_Aan_Zee, aes(x=Egmond_Aan_Zee$timestamp)) + geom_line(aes(y=Egmond_Aan_Zee$sr)) + geom_line(aes(y=Egmond_Aan_Zee$ss)) + labs(title = " Sunrise/Sunset - Egmond_Aan_Zee 2024", x = "Date", y = "Time") pdf("Egmond_Aan_Zee_SA_SU.pdf", paper="a4r", width=11) locsrss dev.off() png(filename="Egmond_Aan_Zee_SA_SU.png", width = 1400, height = 800, units = "px") locsrss dev.off() Egmond_Aan_Zee["Sunrise"] <- strftime(Egmond_Aan_Zee$sr, format="%H:%M") Egmond_Aan_Zee["Sunset"] <- strftime(Egmond_Aan_Zee$ss, format="%H:%M") write.table(Egmond_Aan_Zee, file="Egmond_Aan_Zee_SaSu.csv", dec=',', sep=';', row.names=FALSE)