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