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