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