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