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