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