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