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