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