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