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