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