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