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