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