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