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