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