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