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