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