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