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