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