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