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