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