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