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