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