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