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