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