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