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