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