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