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