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