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