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