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