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