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