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