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