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