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