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