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