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