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