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