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