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