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