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