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