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