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