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