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