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