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