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