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