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