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