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