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