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