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