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