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