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