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