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