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