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