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