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