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