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