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