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