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