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