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