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