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