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