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