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