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