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