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