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