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