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