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