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