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