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