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