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