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