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