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