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