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