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