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