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