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