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