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