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