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