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