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