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