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