library(lubridate) library(ggplot2) library(StreamMetabolism) library(xts) library(reshape) library(scales) Bottrop_ <- sunrise.set(51.529086,6.944688699999999, "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)