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