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