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