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