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