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