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