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