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