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