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