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