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