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