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