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