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