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