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