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