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