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