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