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