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