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