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