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