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