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