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