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