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