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