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