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