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