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