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