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