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