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