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