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