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