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