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