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