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