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