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