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