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