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