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