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