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