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