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