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