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