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