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