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