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