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