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