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