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