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