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