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