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