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