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