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