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