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