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