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