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