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