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