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