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