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