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