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