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