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