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