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