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