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