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