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