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