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