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