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