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