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