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