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