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