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