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