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