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