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