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