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