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