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