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