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