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