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