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