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