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