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