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