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