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