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