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