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