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