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