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