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