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