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