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