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