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